Adds git shorthand functions for shell

This commit is contained in:
William Carroll 2016-05-04 11:13:19 -07:00
parent 530ce58896
commit 91de4f7690

21
.git_functions.sh Normal file
View file

@ -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
}