当前位置:   article > 正文

git 找到冲突_git怎么知道哪个文件冲突

git 冲突文件怎么看

匿名用户

1级

2018-11-19 回答

方法一(推荐使用):

git pull 出现冲突后丢弃本地冲突文件修改,采用远程文件覆盖本地文件

git checkout [文件路径]

例:git checkout test/src/main/resources/spring-shiro.xml

方法二:

git pull 出现冲突后可以暂存本地修改git stash ,然后git pull 更新代码,git stash list 可查看暂存记录列表,释放本地暂存 git stash apply stash@{0} ,出现冲突文件,找到并解决,然后可以提交git add . 加入索引库,然后本地提交git commit -m '注释' 最后git push到远程

方法三:

1.git pull

更新代码,发现

error: Your local changes to the following files would be overwritten by merge:pom.xml

Please commit your changes or stash them before you merge.

这说明你的pom.xml与远程有冲突,你需要先提交本地的修改然后更新。

2.git add pom.xml

git commit -m '冲突解决'

提交本地的pom.xml文件,不进行推送远程

3.git pull

更新代码

Auto-merging pom.xml

CONFLICT (content):

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/767994
推荐阅读