![]() Luckily, we can avoid having to create any actual files by relying on process substitution instead. The comm command is used to compare two sorted files line by line. Git fetch -prune origin +refs/tags/*:refs/tags/* # delete all local tags that are no longer present on the remote # delete all tags on the remote that do not have the release-5 tag as an ancestorĬomm -23 <(git tag | sort) <(git tag -contains release-5 | sort) | xargs git push -delete origin The remainder of this section will focus on explaining this command. Most of these commands are pretty self-explanatory, except for the one in the middle. ![]() The sequence of commands below deletes all tags that do not have the release-5 tag as an ancestor. In this scenario, all you have to do is tag the merge commit and then use this as the cut-off tag. This is especially useful for when you have just merged a new feature, and now you want to delete all tags that were created before this merge. All tags that can trace their ancestry back to this cut-off tag will be allowed to remain. This approach has us specify a cut-off tag. In this article, we’ll look at two approaches to rid yourself of these old tags. It is at this point, when you have well in excess of tens of thousands of tags, that a call to action tends to be made. This onslaught of tags tends to be tolerated until it starts impacting git performance. It’s very easy for a Github repository to accumulate lots of tags over time. Finding and deleting old tags in a Github repository Jul 18, 2014 ![]()
0 Comments
Leave a Reply. |