How to push git tag to remote (With Example)

 

Once you can create a git tag on your local, it's time to push it to remove it so that it can be deployed for the project release.

This blog post will guide you on how to push git tags to the remote.

Git push tags to remote

Pushing a tag in git to a remote is similar to pushing a branch to a git remote. The only difference is that you need to mention the tag name after the "git push" command as by default this command only pushed the branch.

Syntax:

$ git push <remote> <tagname>

Example:

$ git push origin v1.0

Counting objects: 247, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (167/167), done.
Writing objects: 100% (247/247), 333.76 KiB | 27.81 MiB/s, done.
Total 247 (delta 75), reused 245 (delta 74)
remote: Resolving deltas: 100% (75/75), completed with 2 local objects.
To github.com:novicedev/novicedev.git
 * [new tag]               v1.0 -> v1.0

Push all git tags to remote

And if you want to push all tags from your local to the remote then add "--tags" to the git command and it will push all tags to the remote. But it is not recommended to push all tags to remote as later it will be very difficult to get rid of bad tags from remote.

git push origin --tags

 

Here are some references to detailed documentation around Git Tagging:

 

You can read further about git tags in the following articles:

Comments

Add new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
4 + 14 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.