diff --git a/.git_functions.sh b/.git_functions.sh new file mode 100644 index 000000000..5eaafbb49 --- /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 +}