You can't merge with local modifications. Git protects you from losing important changes. You have three options. One is to commit the change using
git commit -m "My message"
The second is to stash it. stashing acts as a stack, where you can push changes, and you pop them in reverse order.
To stash type:
git stash
Do the merge, and than pull the stash:
git stash pop
The third options is to discard the local changes using git
reset --hard.
本文介绍了在使用Git过程中遇到本地修改无法直接合并的情况时的三种解决方案:一是提交更改;二是使用stash暂存更改并在合并后再恢复;三是放弃本地更改。
874

被折叠的 条评论
为什么被折叠?



