How to REALLY remove a tag on git / SourceTree

I know how to remove a tag from SourceTree. Just right-click, delete and check "remove tag from all remotes". Then it does the following (and I skip the flags -c diff.mnemonicprefix=false -c core.quotepath=falsefor reading):

git tag -d my_tag
git push -v origin :refs/tags/my_tag

It works.

Here is the problem.

After some time, one of the other developers will push its branch of functionality to the original one, and SourceTree will automatically move all local tags to the remote server. This recreates the tag I just deleted.

I know that the idea is that tags are not "supposed" deleted, for example. flagged releases, but errors sometimes occur.

Any tips?

+4
1

, , - . script help .

, - git fetch -p -t, git 1.9.4.

, - :

git tag -l | xargs git tag -d # remove all local tags
git fetch -t                  # fetch remote tags

:

git tag -l | xargs git tag -d && git fetch -t

, ~/.gitconfig, :

~/.gitconfig

[alias]

     pt = !git tag -l | xargs git tag -d && git fetch -t 

pt, :

git pt
+4

Source: https://habr.com/ru/post/1628264/


All Articles