I'm trying to write an alias up
for git which does the following
- Stash changes to current branch
foo
- Checkout master
- Fetch/Pull
- Checkout
foo
git merge master
- Restore stashed changes
up = !git stash save masterupdate && git checkout master && git fetch && git pull && git checkout @{-1} && git merge master && git stash pop stash^{/masterupdate}
This works unless there is a merge conflict that needs to be resolved. In such cases, it stops at the conflict step and I need to manually apply the stash.
- How can I make it so upon resolving the merge conflict the rest of the chained commands would continue as normal again?
- Is the only option to make a second alias for this case?
- Can the stash messages be squelched in the case of no change?
My workflow involves making pull requests which then get reviewed by other team members, rebasing is not an option as it would destroy their comments