Skip to content

Instantly share code, notes, and snippets.

@Xunnamius
Last active November 24, 2024 15:07
Show Gist options
  • Save Xunnamius/e14923f87fee948b174e400a144a371d to your computer and use it in GitHub Desktop.
Save Xunnamius/e14923f87fee948b174e400a144a371d to your computer and use it in GitHub Desktop.
Clean up any tag mess when fetching from upstream when you're operating on a downstream fork
# Clean up the mess of tags that came in from upstream
git push upstream --delete $(git ls-remote --tags upstream | grep "YOUR_TAG_PREFIX_HERE.*[^}]$" | cut -f 2)
# Depending on the use case and tag format, other forms may be more appropriate, e.g.:
git tag --delete $(git ls-remote --tags upstream | cut -f 2 | cut -f 3 -d /)
# Stop git from pulling tags from upstream in the future
git config remote.upstream.tagopt --no-tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment