Last active
December 12, 2015 07:09
-
-
Save X0nic/4734616 to your computer and use it in GitHub Desktop.
Handy Git Commands
This file contains 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 old git remote branches | |
git remote prune origin --dry-run | |
git remote prune origin | |
#fancy git log | |
git log --graph --pretty=format:'%Cred%h%Creset %C(yellow)%an%d%Creset %s %Cgreen(%cr)%Creset' --date=relative | |
#alias, put in ~/.gitconfig | |
#[alias] | |
# lg = log --graph --pretty=format:'%Cred%h%Creset %C(yellow)%an%d%Creset %s %Cgreen(%cr)%Creset' --date=relative | |
# Find out which branch a commit is in | |
git branch --contains <the commit> | |
# change rename limit | |
git config merge.renameLimit 999999 | |
git config --unset merge.renameLimit | |
# revert single file | |
git checkout [commit-ref] -- [filename] | |
git checkout HEAD~5 [filename] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment