为什么不让git diff显示任何未合并路径 [英] Why doesn't git diff show anything for unmerged paths
问题描述
合并两个分支时,很多次合并失败,我必须单独解析差异。
一些文件合并成功,其差异我可以看到使用
git diff --staged< merged-file>
问题是,对于未合并路径,当我尝试检查引入的差异时,我什么都看不到。
git diff< unmerged-file>
但是,当我尝试用远程主分支进行区分时,差异会出现。
git diff origin / master< unmerged-file>
为什么会发生这种情况?合并操作是否更新我的本地HEAD或什么?
此外,当我使用 git add
来标记分辨率时,它们永远不会进入暂存区域,是那为什么 git diff
没有显示任何内容? 只有这样我才能看到冲突文件的变化是:
git diff --merge< unmerged-file>
While merging two branches, many a times the merge fails, and I've to resolve the diffs individually.
Some files which merge successfully, whose diff I'm able to see using
git diff --staged <merged-file>
The problem is that for unmerged-paths, when I try to check the diffs introduced I see nothing.
git diff <unmerged-file>
But when I try to diff it with remote master branch, then the diffs appear.
git diff origin/master <unmerged-file>
Why is this happening>? Is the merge operation updating my local HEAD or something?
Moreover when i use git add
to mark resolution, they never go into the staging area, is that the reason why git diff
is not showing anything?
The only way I'm able to see the changes for conflict files is:
git diff --merge <unmerged-file>
这篇关于为什么不让git diff显示任何未合并路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!