git CheatSheet
Remove a file from last commit
# put files back to staging
$ git reset --soft HEAD^
# unstage the file
$ git reset -- file.md
Show all local and remote Branches
$ git branch -a
To remove a specific commit from history, rebase it.
g l
git rebase -i <HASH-PREVOUS-COMMIT>
git push --force-with-lease origin master
.To remove or convert files in the git history, use BFG (brew install bfg
).
$ bfg --convert-to-git-lfs '*.mv4' --no-blob-protection
$ git reflog expire --expire=now --all && git gc --prune=now --aggressive