Skip to content
Browse files

Add script to rebase Git branches.

  • Loading branch information...
1 parent d24c338 commit 9633f6da18238727376a9461db4d58a6f9564ad4 @MikeMcQuaid committed Nov 15, 2012
Showing with 14 additions and 0 deletions.
  1. +14 −0 git-rebase-all-branches
View
14 git-rebase-all-branches
@@ -0,0 +1,14 @@
+#!/bin/sh
+# Rebase all branches on top of origin/master (or origin/staging for staging)
+
+GIT_CURRENT_BRANCH=$(git symbolic-ref HEAD|sed -e 's/refs.heads.//')
+
+git fetch --all
+
+git checkout staging && git rebase origin/staging
+for i in $(git branch|egrep -v '\*|staging')
+do
+ git checkout $i && git rebase origin/master
+done
+
+git checkout $GIT_CURRENT_BRANCH

0 comments on commit 9633f6d

Please sign in to comment.
Something went wrong with that request. Please try again.