【CMD|GIT】git pull时,本地有未提交改动

2023-11-21  本文已影响0人  盐果儿

报错提醒:

error: Your local changes to the following files would be overwritten by merge:

<file-name>

Please commit your changes or stash them before you merge.

解决方案:

1. 提交改动(Commit your changes)

git add <file-name>

git commit -m "Committing local changes before merge"

2. 保存更改(Stash your changes)

git stash

git merge <branch-name>

git stash pop

3. 放弃更改(Discard your changes)

git checkout -- <file-name>

上一篇 下一篇

猜你喜欢

热点阅读