Created
November 5, 2008 17:51
-
-
Save Peeja/22386 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
# Git aliases for bash | |
alias gst='git status' | |
alias gf='git fetch' | |
alias gl='git pull' | |
alias gp='git push' | |
alias gc='git commit -v' | |
alias gca='git commit -v -a' | |
alias gb='git branch' | |
alias gba='git branch -a' | |
function gbt() { git checkout --track origin/$1 -b $1; } | |
alias ga='git add' | |
alias gai='git add -i' | |
# alias gdc='git diff --cached | mate' | |
# | |
# function gd() { | |
# git diff "$@" | mate | |
# } | |
alias gd='git diff' | |
alias gdc='git diff --cached' | |
alias gcps='git cherry-pick -n -m 1 stash' | |
by_status() { | |
ruby <<-RUBY | |
files = [] | |
IO.popen("git status").each do |l| | |
if l =~ /^#\s+$1:\s+(.+)$/ | |
files << \$1 | |
end | |
end | |
puts files.join("\n") | |
RUBY | |
} | |
unmerged() { by_status unmerged; } | |
modified() { by_status modified; } | |
alias untracked='gst | ruby -n -e "if \$u; puts \$1 if \$_=~/^#\t(.+)\$/; else; \$u=(\$_=~/to include in/); end"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment