diff options
author | William Carroll <wpcarro@gmail.com> | 2016-05-04T18·13-0700 |
---|---|---|
committer | William Carroll <wpcarro@gmail.com> | 2016-05-04T18·13-0700 |
commit | 91de4f76903bb378da2eb636982a7975bdb9936c (patch) | |
tree | c67daab620f65a395822400087c0def35c3cafaf | |
parent | 530ce588967387eee0563ca4906d2dcced405195 (diff) |
Adds git shorthand functions for shell
-rw-r--r-- | .git_functions.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/.git_functions.sh b/.git_functions.sh new file mode 100644 index 000000000000..5eaafbb498ad --- /dev/null +++ b/.git_functions.sh @@ -0,0 +1,21 @@ +# combine fetch and rebase (git frebase) +function wgfreebase { + if [ -z $1 ]; then + branchname="$(git symbolic-ref HEAD 2> /dev/null | cut -f3 -d'/')" + else + branchname="$1" + fi + + git fetch origin "$branchname" && git rebase origin/"$branchname" +} + +# push to current branch +function wgpush { + if [ -z $1 ]; then + branchname="$(git symbolic-ref HEAD 2> /dev/null | cut -f3 -d'/')" + else + branchname="$1" + fi + + git push origin $branchname +} |