File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -16,22 +16,22 @@ RSTASH=$(git stash create --include-untracked)
1616
1717if [[ $RSTASH ]]; then
1818 echo " Stashed $RSTASH "
19+ git stash store -m " Remaster on branch $BRANCH $( date) " " $RSTASH "
1920 git reset --hard
2021fi
2122
2223# fetch updates
23- git fetch --prune --no-tags origin $MASTER
24-
25- # if not on master branch, check it out, update and return to branch
26- if [[ $BRANCH != $MASTER ]]; then
27- git checkout $MASTER
24+ if git fetch --prune --no-tags origin $MASTER ; then
25+ # if not on master branch, check it out, update and return to branch
26+ if [[ $BRANCH != $MASTER ]]; then
27+ git checkout $MASTER
28+ git rebase origin/$MASTER --preserve-merges
29+ git checkout -
30+ fi
31+ # rebase changes on top of origin/master
2832 git rebase origin/$MASTER --preserve-merges
29- git checkout -
3033fi
3134
32- # rebase changes on top of origin/master
33- git rebase origin/$MASTER --preserve-merges
34-
3535# bring back stash if available, hide errors when empty
3636if test $RSTASH ; then
3737 git stash apply $RSTASH
You can’t perform that action at this time.
0 commit comments