Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

I use SourceTree to manage all my Git repositories, it's a great tool but sometimes something goes wrong with remote tags refs in one of my work repositories and I get error messages when I do a push that tells me that a bunch of tags have been rejected. Now I never actually create any tags so this is a little confusing. Cloning a fresh version of the repository fixes this but is not a solution all the time, especially if you have a bunch of stashes. Luckily there is an option in SourceTree to disable pushing tags to remotes.

This is the kind of error message I get...
 Git
To [email protected]:myuser/myrepo.git
= [up to date] develop -> develop
= [up to date] 7.0.5.1 -> 7.0.5.1
= [up to date] 7.0.6.1 -> 7.0.6.1
= [up to date] 7.0.7.1 -> 7.0.7.1
= [up to date] 7.0.8.1 -> 7.0.8.1
= [up to date] 7.0.9.1 -> 7.0.9.1
! [rejected] 7.0.10.1 -> 7.0.10.1 (already exists)
! [rejected] 7.0.11.1 -> 7.0.11.1 (already exists)
! [rejected] 7.1.1.1 -> 7.1.1.1 (already exists)
updating local tracking ref 'refs/remotes/origin/develop'
error: failed to push some refs to '[email protected]:myuser/myrepo.git'
hint: Updates were rejected because the tag already exists in the remote.

gittags_1.png


The culprit is shown below. In the 'push' dialog there is an option to 'Push all tags'. Unticking that makes the errors go away.
gittags_2.png




There is a better way to do this via Preferences under the 'Git' tab simply untick 'Push all tags to remotes' and you're done.
gittags_3.png


-i

Hope you found this post useful...

...so please read on! I love writing articles that provide beneficial information, tips and examples to my readers. All information on my blog is provided free of charge and I encourage you to share it as you wish. There is a small favour I ask in return however - engage in comments below, provide feedback, and if you see mistakes let me know.

If you want to show additional support and help me pay for web hosting and domain name registration, donations, no matter how small, are always welcome!

Use of any information contained in this blog post/article is subject to this disclaimer.
comments powered by Disqus
Other posts you may like...