How to resolve git stash conflict without commit?
如果在git 中stash了本地修改,然后git pull,之后合并出现冲突,此时会导致问题,解决冲突后保存了,此时做不了其他git操作,例如pull,如何做到解决冲突又不需要commit?
Let us do what Git suggests without performing any useless commits:
- Resolve the conflict(s) manually or using some merge tool.
- Then use git reset to mark conflict(s) as resolved and unstage the changes. Also you can execute it without any parameters and Git will remove everything from the index. You don't have to execute git add before.
- Finally, remove the stash with git stash drop, because Git doesn't do that on conflict.
Translated to the command-line,下面是操作代码:
$ git stash pop
# ...resolve conflict(s)
$ git reset
$ git stash drop