git merge 报错:error: Your local changes to the following files would be overwritten by m
程序员文章站
2022-07-13 21:12:11
...
error log:
error: Your local changes to the following files would be overwritten by merge:
app/Http/Controllers/User/UserIndexController.php
Please commit your changes or stash them before you merge.
Aborting
You can't merge with local modifications. Git protects you from losing potentially important changes. You have three options.
- One is to commit the change using
git commit -m "My message"
- 2.The second is to stash it. stashing acts as a stack, where you can push changes, and you pop them in reverse order.
To stash type:
git stash
Do the merge, and than pull the stash:
git stash pop
- The third options is to discard the local changes using
git reset --hard.
上一篇: git pull error: Your local changes to the following files would be overwritten by merge:
下一篇: git 删除本地修改 Your local changes to the following files would be overwritten by merge
推荐阅读
-
Your local changes to the following files would be overwritten by merge:
-
git 出现 error: Your local changes to the following files would be overwritten by merge
-
git pull error: Your local changes to the following files would be overwritten by merge:
-
git merge 报错:error: Your local changes to the following files would be overwritten by m
-
git 删除本地修改 Your local changes to the following files would be overwritten by merge
-
git pull 提示错误,Your local changes to the following files would be overwritten by merge
-
git:error: Your local changes to the following files would be overwritten by merge:
-
Git出现冲突error: Your local changes to the following files would be overwritten by merge
-
git pull报错:error: Your local changes to the following files would be overwritten by merge:
-
git pull 提示错误,Your local changes to the following files would be overwritten by merge