使用git pull同步github代码到服务器

我直接用git pull的时候遇到这个错误:

error: Your local changes to the following files would be overwritten by merge:
        protected/config/main.php
Please, commit your changes or stash them before you can merge.

希望用代码库中的文件完全覆盖本地工作版本. 方法如下

git reset --hard
git pull

然后就可以了

posted @ 2019-02-17 19:15  yzloo  阅读(2203)  评论(0编辑  收藏  举报