[git] Add cherry-pick-range alias

This commit is contained in:
Ivan Malison 2017-11-16 20:02:24 -08:00
parent 5f32abd058
commit 7e4cd192bc
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8

View File

@ -6,13 +6,15 @@
branches = branch -a
c = clone --recursive
ca = !git add -A && git commit -av
cherry-pick-range = "!c() { git cherry-pick $1^..$2; }; c"
cpr = cherry-pick-range
cam = commit -am
clean-branches = "!r() { git branch --merged ${1-origin/master} | grep -v '*' | xargs -n1 git branch -d; }; r"
clone = clone --recursive
credit = "!f() { git commit --amend --author \"$1 <$2>\" -C HEAD; }; f" # Credit an author on the latest commit
co = checkout
d = "!d() { git icdl $@; }; d"
db = !"db() { git diff HEAD~"$1"; }; db"
db = "!db() { git diff HEAD~"$1"; }; db"
diff-excluding = "!f() { exclude=$1; shift; git diff $1 $2 --name-only | grep -v $exclude | xargs git diff "$@" --; }; f"
fdiff = "!f() { filter=\"$1\"; shift; git diff $1 $2 --name-only | $filter | xargs git diff "$@" --; }; f"
dirty = "!t() { test -n \"$(git status --porcelain)\"; }; t"