参考
Git冲突:commit your changes or stash them before you can merge.
总结
如果git pull 报错 Please commit your changes or stash them before you merge.
如果需要保留自己本地的修改,就依次执行以下命令即可
git status
git stash
git pull
git status
git stash pop
如果放弃本地修改,也直接覆盖
git reset --hard
git pull
解释以下命令stash
执行 git pull 命令,报错如下
# git pull
error: Your local changes to the following files would be overwritten by merge:
README.md
Please commit your changes or stash them before you merge.
Aborting
Updating ade5dfc..518b768
1.查看状态(可省略)
# git status
On