PULL代码时遇到冲突怎么办 error:Your local changes to the following files would be overriten by merge

当你需要更新提交代码的时候,如果和别人修改了同样的文件,会有如下报错

PULL代码时遇到冲突怎么办 error:Your local changes to the following files would be overriten by merge

解决方案:

1git stash  (放到暂存区)

2git pull origin XX  (更新代码)

3git stash pop (弹出放入暂存区的内容)

接下来就可以就可以正常的commit 和push啦

一般操作是     git add .(加到本地)       git commit  -m ‘注释'       git push