Skip to content

Instantly share code, notes, and snippets.

@phryneas
Created February 7, 2020 17:40
Show Gist options
  • Save phryneas/fbbfb8a2281baf3b0d383da26a5095de to your computer and use it in GitHub Desktop.
Save phryneas/fbbfb8a2281baf3b0d383da26a5095de to your computer and use it in GitHub Desktop.
Retag RTK Tutorials
#!/usr/bin/env bash
#remove all git tags
git tag | xargs git tag -d
#re-apply all git tags with commit name => tag name
git log --pretty=%s---%H | sed -re 's/[^a-zA-Z0-9-]/_/g;s/---/ /' | xargs -n2 git tag
git tag --format="%(objectname) => %(refname)"
@phryneas
Copy link
Author

phryneas commented Feb 9, 2020

Changing commit 9cdbe41d4c4a1ea6799d9542b1aa809670002094:

  • git rebase -i 9cdbe41d4c4a1ea6799d9542b1aa809670002094^ (rebase to commit BEFORE the actual commit, note the ^)
  • choose e to edit the commit
  • make changes
  • git commit -a --amend
  • git rebase --continue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment