Created
October 19, 2012 10:56
-
-
Save hachibeeDI/3917553 to your computer and use it in GitHub Desktop.
zsh function for git
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
# http://qiita.com/items/1f01aa09ccf148542f21 | |
gs() { | |
git status -sb | |
} | |
gst() { | |
git status -sb | head -n 1 | |
git status -sb | sed '1d' | grep --line-number '^' | |
} | |
gsa() { | |
local targfile; | |
targfile=`git status -sb |grep -v "^#" | awk '{print$1="";print}' |grep -v "^$" | awk "NR==$1" | sed "s/\s//g"` | |
echo "add $targfile" | |
git add $targfile | |
} | |
gsd() { | |
local targfile; | |
targfile=`git status -sb |grep -v "^#" | awk '{print$1="";print}' |grep -v "^$" | awk "NR==$1" | sed "s/\s//g"` | |
echo "show diff $targfile" | |
git diff --color -- $targfile | |
} | |
gsv() { | |
local targfile; | |
targfile=`git status -sb |grep -v "^#" | awk '{print$1="";print}' |grep -v "^$" | awk "NR==$1" | sed "s/\s//g"` | |
vim $targfile | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment