简体   繁体   中英

Remove git tags from all branches in repositories of all team members

We have several repositories in our team, one central remote and one local for EACH team member. There are also more than one branch in the repositories.

I tried to follow the instruction to remove git tag both on my local repository and the remote

git tag -d 12345
git push origin :refs/tags/12345

However, after some time, these tags creep back into the remote repository. I suspect that it was because that these tags were still present in other team members' local repositories, and they were git pushed to the remote repository somehow.

Is there a robust way to remove git tags from ALL branches of repositories of all team members?

No.

As you have no doubt seen or tried, the "directive to all team members" method is about 60% to 75% effective up front, and since a single member who fails to follow it causes everyone else to be re-infected with the tag, it's approximately 0% effective in the end. :-)

The trick to make this work with a centralized repository work-flow is to put a rule in the git hooks on the central server that rejects an attempt to re-create the tag. Whether to add Public Shaming to the rejection (by having the centralized server email out a message along the line of "hey, developer X was trying to re-create the bad tag!") is up to you. :-)

It's not possible, but you can improve your git workflow, in my team we use git up for everything, not git pull. That tool syncs ALL repo with the local.

Another problem that you have is one person into the team push with force and not branch by branch, send a message for that member team syncs the repo with remote and doesn't send push with force or when somebody creates a new tag.

git up implementation - https://github.com/msiemens/PyGitUp

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM