about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2016-05-04T18·13-0700
committerWilliam Carroll <wpcarro@gmail.com>2016-05-04T18·13-0700
commit91de4f76903bb378da2eb636982a7975bdb9936c (patch)
treec67daab620f65a395822400087c0def35c3cafaf
parent530ce588967387eee0563ca4906d2dcced405195 (diff)
Adds git shorthand functions for shell
-rw-r--r--.git_functions.sh21
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
+}