git merge 报错:error: Your local changes to the following files would be overwritten by m

版权声明: https://blog.csdn.net/geeksoarsky/article/details/83154063

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.

猜你喜欢

转载自blog.csdn.net/geeksoarsky/article/details/83154063
今日推荐