2019-11-29 10:12:14 0 评论 Git Boy.Lee

Git实例: 放弃当前修改强制覆盖本地版本

在使用git的时候,有时候我们需要放弃本地修改使用git的内容直接覆盖,这种情况在线上环境尤为突出,本文详细介绍了相关命令

 

{ 相关错误 }

From https://git.yiilib.com/demo/
   9f84dae..7c1b32c  master     -> origin/master
Updating 696364b..7c1b32c
error: Your local changes to 'api/config/main-local.php' would be overwritten by merge.  Aborting.
Please, commit your changes or stash them before you can merge.

 

{ 解决办法 }

git reset --hard
git pull