Skip to content

Instantly share code, notes, and snippets.

@renkin
Last active July 30, 2018 12:54
Show Gist options
  • Save renkin/863aa30d4e05a15b40acf166b69fbb31 to your computer and use it in GitHub Desktop.
Save renkin/863aa30d4e05a15b40acf166b69fbb31 to your computer and use it in GitHub Desktop.
# Remove e.g. large files
git filter-branch prune-empty -index-filter "git rm -cached -f -ignore-unmatch TWUndDieWeihnachtsmaenner.mpg" -all
# Edit commit message of the last commit
git commit --amend
# Modify last or one of the last 3 commits or only their commit messages
git rebase -i HEAD~3
# Merge current staging area content with last commit
git commit --amend
# Remove last commit (changes are kept in local working area)
git reset --soft HEAD^
# Remove a single or multiple tags (first git command is local removal, the second remote)
TAG='v0.1.0'; git tag -d $TAG && git push origin :$TAG
for TAG in v0.2.0 v0.2.1; do git tag -d $TAG && git push origin :$TAG; done
@renkin
Copy link
Author

renkin commented Jul 30, 2018

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