Pushing branches and tags with a single "git push" invocation
With recent versions of Git you can do this with
git push --follow-tags.
Normally pushing branches and tags is a two step process:
$ git push $ git push --tags
A handy tip was just posted to the Git mailing list by Zoltán Füzesi:
.git/configto solve this:[remote "origin"] url = ... fetch = +refs/heads/*:refs/remotes/origin/* push = +refs/heads/* push = +refs/tags/*
With these lines added
git push originwill upload all your branches and tags. If you want to upload only some of them, you can enumerate them.
Haven't tried it myself yet, but it looks like it might be useful until some other way of pushing branches and tags at the same time is added to
git push. On the other hand, I don't mind typing:
$ git push && git push --tags
Add a comment
Comments are now closed for this article.