Why does cherry-pick tell me that I have all lines changed?

一个人想着一个人 提交于 2019-12-06 09:42:52

This sometimes happens if you change the newline type (Windows newline vs Unix newline). git can show diff ignoring whitespace changes.

When you select a commit in the git-gui history browser, it is showing what changed between that commit and its first parent, in this case the same output as git diff A^..A. Since branch A did not have this file until in its last commit, the diff naturally shows the whole file as new. B is not even considered at this point.

When you diff the two branch heads (git diff A..B) you will see the direct difference between A and B regardless of the histories of the two.

More information on the syntax used for git diff above may be found in man git-revisions.

As for the cherry-pick, it gets it right thanks to three-way merge.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!