Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.
Notice: I'm taking a break from blogging to focus on Atari Gamer . com, check it out!

NOTE: This article is 3 years or older so its information may no longer be relevant. Read on at your own discretion! Comments for this article have automatically been locked, refer to the FAQ for more details.
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...
To [email protected]:myuser/myrepo.git
= [up to date] develop -> develop
= [up to date] ->
= [up to date] ->
= [up to date] ->
= [up to date] ->
= [up to date] ->
! [rejected] -> (already exists)
! [rejected] -> (already exists)
! [rejected] -> (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.


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

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.


Skip down to comments...
A quick disclaimer...

Although I put in a great effort into researching all the topics I cover, mistakes can happen. If you spot something out of place, please do let me know.

All content and opinions expressed on this Blog are my own and do not represent the opinions of my employer (Oracle). Use of any information contained in this blog post/article is subject to this disclaimer.
comments powered by Disqus
Other posts you may like...