Last active
December 23, 2015 02:39
-
-
Save baojie/6567756 to your computer and use it in GitHub Desktop.
install some useful git shortcuts. Depends on https://github.com/visionmedia/git-extras
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
# show log in online and color | |
# Usage: tig | |
sudo apt-get install tig | |
# git extras | |
# Usage: see https://github.com/visionmedia/git-extras | |
(cd /tmp && git clone --depth 1 https://github.com/visionmedia/git-extras.git && cd git-extras && sudo make install) | |
# full commit history with diff of a file | |
# Usage: git history foo.py | |
git config --global alias.history 'log --follow --color -p' | |
# reset the working dirtory to head, remove all edit | |
# Usage: git giveup | |
git config --global alias.giveup 'reset HEAD^ --hard' | |
# push too all remote | |
# Usage: git pushall | |
git config --global alias.pushall '!sh -c "git remote | xargs -L1 -I {} git push {} master"' | |
# Show commit history as a graph | |
# Usage: git graph | |
git config --global alias.graph 'log --graph --oneline --all --decorate --color' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment