views:

679

answers:

1

I probably did this incorrectly.

I made some changes to a git repository and committed these successfully, pushing them to the central repository. I realise now that I want to tag the current version of all files. So I do:

git tag -a 0.5

That succeeds. But now I try a git push and I am told there's nothing to commit. How do I push my new tag to the central repository?

(Note that 'git tag' shows the tag 0.5, but only locally)

+16  A: 

I think you want

git push --tags

as that, well, pushes all your tags :)

There are some alternatives of course, this being git and all (replace origin with your repo of choice):

git push origin tag 0.5

or

git push origin refs/tags/0.5:refs/tags/0.5

See git-push(1) for further details. "git ready" has some useful info in their tagging article as well.

Henrik Gustafsson
Yeap! That's exactly it, thanks.
ChrisInEdmonton
**Addendum:** if you create new commits on your branch, and then push (so there is something to transfer), git should detect all new tags that point to commits that are present after push on remote side, and push them too.
Jakub Narębski