目录
问题再现
出现冲突常常表现在我们Pull之后
提示如下
error: Your local changes to the following files would be overwritten by merge:
选择保留本地代码
这种办法让你本地代码和远程代码合在一起
git stash
git pull origin master
git stash pop
效果是你目前既有远程仓库的代码也有自己本地的代码。你再add,commit,push即可把这些内容全部同步到远程
远程代码覆盖本地代码
这种办法会让远程代码覆盖你本地代码
git reset --hard
git pull origin master