git 冲突解决技巧

来源:互联网 发布:阿里移动推荐算法总结 编辑:程序博客网 时间:2024/05/22 07:44

提交版本后出现冲突
如果冲突在同一行,git pull之后再提交就解决了
如果冲突不在同一行 git pull之后也会有冲突
git pull 之后有冲突:
$ git pull
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From g:/software/repository/git/itheima26
   50db030..a04027a  master     -> origin/master
Auto-merging readme.txt
CONFLICT (content): Merge conflict in readme.txt
Automatic merge failed; fix conflicts and then commit the result.
解决方法:
1.git mergetool
调用上面命令之后会提示你输入编辑方法,输入:beyond compare 进入编辑器.
2.编辑完之后.调用git commit -a 把当前目录中所有都提交到本地库中.
3.git push origin master 提交到远程库中.

原创粉丝点击