在 Git 中,有没有一种方法可以自动将合并冲突中的所有较新版本的文件标记为正确?
所以我遇到了与我的存储库的合并冲突,旧版本都已经有大约 1 个月的历史了,是否有任何简单的命令可以将所有较新的版本标记为正确,而不必为每个单独的文件执行此操作(我是处理约 1000 个文件)
谢谢
So I've come across a merge conflict with my repo, the older versions are all ~1 month old, is there any simple command to mark all the newer versions as correct rather than having to do it for every individual file (I'm working with ~1000 files)
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如 Git merge 命令中所述, 递归策略接受我们的和他们的选项等。这两个选项分别通过覆盖现有或传入版本来解决冲突。
我不知道您的情况是哪个版本较新,因此我无法准确告诉您应该指定两个选项中的哪一个,但我想您会弄清楚的。
注意: 正如 @Mark Longair 所指出的,ours 策略也存在,但与 ours 选项对 ours 的效果不同>递归策略。小心不要混淆它们。
As described in the Git merge command, the recursive strategy accepts the ours and theirs options, among others. Both options resolve conflicts by overwriting the existing or incoming versions, respectively.
I don't know which version is the newer in your case, so I cannot tell you exactly which of the two options you should specify, but I guess you'll figure it out.
Note: As pointed out by @Mark Longair, the ours strategy also exists, but has a different effect than the ours option to the recursive strategy. Be careful not to confuse them.