How to stash working tree, update the local branch and merge the both modified
What is the best way to stash working tree, update the local branch and then merge the both files modified either on local and on remote branch?
I’m doing as following:
- First, I
git stash, the shortcut for
git stash saveand save my working tree
- Then I
git pull, to update my local branch.
- Since my branch is updated, I use
git stash popto remove a single stashed state from the stash list and apply it on top of the current working tree state.
This isn’t that bad, altough the merge part isn’t the best. I just want to merge the changes, if possible with mergetool. How can I do it?
One Solution collect form web for “How to stash working tree, update the local branch and merge the both modified”
Why don’t you just commit and rebase?
git commit -a git pull --rebase *fix merge conflicts*
Then if you want to append to that commit you can do
git commit -a --amend
Then if you want to uncommit the commit you just made, but still save your changes, do a soft reset:
git reset --soft HEAD^