我多次陷入这种状况
1. I work on master branch and make some commits
2. Then i use git pull
3. Then i get auto merge fail , conflicting changes
现在假设有5个文件存在冲突。我想知道
1. How can i overwrite those conflicting files with my files on my commit
2. How can i overwrite those with chnages from master
在我做git pull之后
答案 0 :(得分:10)
您可以使用
git checkout --theirs -- path/to/file.txt
检查你提取的内容
git checkout --ours -- path/to/other/file.txt
检查你原来的东西。
git diff --name-only --diff-filter=U | xargs git checkout --ours --
使用所有冲突文件的版本。