Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

After local "move tag", can't push with tags to remote

Aleksandar Vacic
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 26, 2014

Source Tree offers an option to move a tag if I try to tag current commit using existing tag. I did that locally, but now when I try to push to bitbucket, I get the error that tag already exists. 

hint: Updates were rejected because the tag already exists in the remote.

Here's the complete log of the push attempt

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v --tags origin master:master 
Pushing to git@bitbucket.org:*****
To git@bitbucket.org:****
 = [up to date]      master -> master
 = [up to date]      v4.0 -> v4.0
 ! [rejected]        4.0.1 -> 4.0.1 (already exists)
updating local tracking ref 'refs/remotes/origin/master'
error: failed to push some refs to 'git@bitbucket.org:****'
hint: Updates were rejected because the tag already exists in the remote.
Completed with errors, see above

 

How to reconcile this problem?

4 answers

2 votes
Martin Widmer December 6, 2017

I experience the same problem still with v2.3.5.0

The workaround of Serguei Mokhov is possible but very tedious. There should really be an option to move tags on remotes as well.

Martin Widmer December 6, 2017

As mentioned in another forum (https://jira.atlassian.com/browse/SRCTREE-3018), there is another workaround using the git command line to force push the tags:

git push origin --tags -f

If you're often moving tags around, I suggest creating a custom action for this:

Script to run: git

Parameters: push origin --tags -f

Since this only affects tags, there is not as much danger involved as in other forced commands.

Like AKrizan likes this
fcgamedesign May 3, 2019

For me, this works when done in the command line, but it doesn't when I make it a custom action. It says it failed with errors, but no errors are shown (and it doesn't do what it should).

Any ideas what could cause this?

0 votes
Tushar Raut
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 3, 2019
0 votes
s_mokhov
Contributor
December 21, 2015

The only way I've found to move a remote tag is to delete it (from all remotes) and then recreate it again. SourceTree (as of 1.7.0.32509) on Windows is not capable of doing it. This documentation is incomplete, which simply covers a local case where it does work, but does not work for the remote updates with "Tag already exists".

0 votes
Steve Dodd
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 8, 2015

Anyone...?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events