[git] Push git commits & tags simultaneously

I'm aware of the reason that git push --tags is a separate operation to plain old git push. Pushing tags should be a conscious choice since you don't want accidentally push one. That's fine. But is there a way to push both together? (Aside from git push && git push --tags.)

This question is related to git

The answer is


@since Git 2.4

git push --atomic origin <branch name> <tag>


Maybe this helps someone:

git tag 0.0.1                    # creates tag locally     
git push origin 0.0.1            # pushes tag to remote

git tag --delete 0.0.1           # deletes tag locally    
git push --delete origin 0.0.1   # deletes remote tag

Git GUI

Git GUI has a PUSH button - pardon the pun, and the dialog box it opens has a checkbox for tags.

I pushed a branch from the command line, without tags, and then tried again pushing the branch using the --follow-tags option descibed above. The option is described as following annotated tags. My tags were simple tags.

I'd fixed something, tagged the commit with the fix in, (so colleagues can cherry pick the fix,) then changed the software version number and tagged the release I created (so colleagues can clone that release).

Git returned saying everything was up-to-date. It did not send the tags! Perhaps because the tags weren't annotated. Perhaps because there was nothing new on the branch.

When I did a similar push with Git GUI, the tags were sent.

Tags sent with Git GUI

For the time being, I am going to be pushing my changes to my remotes with Git GUI and not with the command line and --follow-tags.