Last active
July 30, 2018 12:54
-
-
Save renkin/863aa30d4e05a15b40acf166b69fbb31 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See also https://demisx.github.io/git/2014/11/02/git-prune-local-tags-dont-exist-remote.html