有没有办法告诉
我有一堆提交似乎假定了一种行尾,而我正在尝试将它们应用于另一个使用另一种行尾的分支。 感觉很不好...
git cherry-pick
使用renormalize
合并策略?我不确定-X
选项是否有效。我有一堆提交似乎假定了一种行尾,而我正在尝试将它们应用于另一个使用另一种行尾的分支。 感觉很不好...
git cherry-pick
使用renormalize
合并策略?我不确定-X
选项是否有效。ignore-all-space
合并策略会完成工作:git cherry-pick -X ignore-all-space <commit-id>
-X ignore-all-space
可以正常工作,但如果不使用忽略空格选项进行 cherry-pick 时出现冲突,您必须手动检查提交。(或者在 cherry-picking 时使用 --no-commit
并使用 git diff --staged
进行审核)-X ignore-all-space
选项看起来很好,但是某些缩进是错误的。 Change from theirs, Indent level 1(no conflict with/out whitespace)
<<<<< HEAD
Indent level 0
=====
Indent level 1 without any code change
>>>>> cherry-picked commit
-X ignore-all-space
不会显示任何冲突,但实际提交将如下所示: Change from theirs, indent level 1
Indent level 0
针对行尾符的变化:这取决于操作系统,但是幸运的是,为了支持多平台开发环境,Git 支持 core.autocrlf 和 core.eol。有关更多详细信息,请参见 git-scm。
-X renormalize
不起作用,但是-X ignore-all-space
能够完成任务... - hwjp