File tree 1 file changed +9
-9
lines changed
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)
16
16
17
17
if [[ $RSTASH ]]; then
18
18
echo " Stashed $RSTASH "
19
+ git stash store -m " Remaster on branch $BRANCH $( date) " " $RSTASH "
19
20
git reset --hard
20
21
fi
21
22
22
23
# 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
28
32
git rebase origin/$MASTER --preserve-merges
29
- git checkout -
30
33
fi
31
34
32
- # rebase changes on top of origin/master
33
- git rebase origin/$MASTER --preserve-merges
34
-
35
35
# bring back stash if available, hide errors when empty
36
36
if test $RSTASH ; then
37
37
git stash apply $RSTASH
You can’t perform that action at this time.
0 commit comments