您的位置:首页 > 其它

Git强制覆盖更新、commit 强行终止后如何操作

2018-01-03 14:57 841 查看
1.我需要放弃本地的修改,用远程的库的内容就可以,应该如何做?傻傻地办法就是用心的目录重新clone一个,正确的做法是什么?正确的做法应该是:
git fetch --all
git reset --hard origin/master
git fetch 只是下载远程的库的内容,不做任何的合并git reset 把HEAD指向刚刚下载的最新的版本2.今天在服务器上git pull是出现以下错误:error: Your local changes to the following files would be overwritten by merge:        application/config/config.php        application/controllers/home.phpPlease, commit your changes or stash them before you can merge.Aborting如果希望用代码库中的文件完全覆盖本地工作版本. 方法如下:git checkout .git pull3.git commit 强行终止后如何操作今天 当我  执行  git add  somefile 的时候,出现 如下 错误:
If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.
解决方法:
rm -f ./.git/index.lock
4.git解决冲突
冲突标记<<<<<<< (7个<)与=======之间的内容是我的修改,
=======与>>>>>>>之间的内容是别人的修改。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息