【Git】pull遇到错误:error: Your local changes to the following files would be overwritten by merge:

tech2024-04-14  12

这种情况下,如何保留本地的修改同时又把远程的合并过来呢?


git stash git pull origin master git stash pop

git stash的时候会把你本地快照,然后git pull 就不会阻止你了,pull完之后这时你的代码并没有保留你的修改。惊了! 别急,我们之前好像做了什么?

STASH

这时候执行git stash pop你去本地看会发现发生冲突的本地修改还在,这时候你该commit push啥的就悉听尊便了。

摘自:

如何保留本地的修改同时又把远程的合并过来

https://blog.csdn.net/nakiri_arisu/article/details/80259531

https://blog.csdn.net/qq_36898043/article/details/79431168

https://blog.csdn.net/loongshawn/article/details/78864039

最新回复(0)