Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to only push a specific tag to remote? [duplicate]

Tags:

git

Is there a command like git push --tag tag_a? I only found git push --tags.

like image 774
Yad Smood Avatar asked Apr 22 '14 06:04

Yad Smood


People also ask

How do I push a tag to a remote branch?

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.

How do I push a specific commit?

(If it doesn't, you can use git push <remotename> <commit SHA>:refs/heads/<remotebranchname> to autocreate it.) If you want to push a commit without pushing previous commits, you should first use git rebase -i to re-order the commits.

Does push send tags to remote?

Sharing TagsBy default, the git push command doesn't transfer tags to remote servers. You will have to explicitly push tags to a shared server after you have created them. This process is just like sharing remote branches — you can run git push origin <tagname> .


1 Answers

You can simply use:

git push origin tag_a 

Alternatively (mainly to solve tag/branch name clashes), you could use:

git push origin refs/tags/tag_a 
like image 151
Pavel Šimerda Avatar answered Sep 20 '22 18:09

Pavel Šimerda