SourceTree にプッシュしようとすると、「タグが既に存在するため更新が拒否されました」というメッセージが表示される 質問する

SourceTree にプッシュしようとすると、「タグが既に存在するため更新が拒否されました」というメッセージが表示される 質問する

ソース ツリー経由でプッシュしようとすると、次のエラーが発生します。

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

私の知る限り、このタグには何も変更を加えていません。どうすれば修正できますか?

ベストアンサー1

これを git bash でも解決できるはずです (ソース ツリー UI の [ターミナル] ボタンをクリックします)。次のように入力します。

git pull --tags

競合するタグがある場合は、-fコマンドにオプションを含めて、競合するローカルのタグをリモート バージョンで上書きすることができます。

git pull --tags -f

おすすめ記事