Merge in master changes before commiting.
[socialgit.git] / changebranch
blob3dfc6bd7e3bd85f5ed67b38b17afd77d3c50220b
1 #!/bin/sh
2 # changebranch
4 CURBRANCH=`currentbranchname`
6 if (( $(git diff HEAD | wc -l) > 0 )); then
7 git branch $CURBRANCH.dirty
8 git checkout $CURBRANCH.dirty
9 echo "stashing dirty working copy" | git commit -a -F -
12 git fetch
13 git checkout -b $1 origin/$1
14 git checkout $1
16 if [ `git branch | grep $1.dirty` ]; then
17 git diff $1 $1.dirty | git apply
18 git branch -D $1.dirty