当 git pull 有冲突时:
$ git pull
From https://github.com/acn-yunan-hu/test
2f97dc7..dce8319 step5/test -> origin/step5/test
error: Your local changes to the following files would be overwritten by merge:
【BlueStep5】ソースRv指摘一覧.xlsx
Please commit your changes or stash them before you merge.
Aborting
Updating 2f97dc7..dce8319
如果想放弃本地更改,用远程的替换本地代码时,可以用下面方法:
git强制覆盖:
git fetch --all
git reset --hard origin/step5/test
git pull
git强制覆盖本地命令(单条执行):
git fetch --all && git reset --hard origin/step5/test && git pull
当然如果你想有冲突文件保存本地更改的时候,可以将 git reset --hard 换成 git reset --soft