gpt4 book ai didi

Git:使用 git-merge-file 来解决使用他们/我们的冲突

转载 作者:太空狗 更新时间:2023-10-29 14:27:20 24 4
gpt4 key购买 nike

我有一个 git svn rebase 并且我遇到了冲突。我想使用 git-merge-file 通过选择服务器上的版本来 merge 文件的两个版本。 git-merge-file 有一个名为 --theirs 的选项,但是 git-merg-file 需要 3 个参数。我怎样才能只将包含冲突标记的文件传递给它并让它选择它们的版本?

我也试过 git merge -Xtheirs file.cpp 但它不起作用。

最佳答案

也许你可以试试:

git checkout --ours file.cpp
git add file.cpp

如果您只是想放弃本地更改以支持上游版本。

事实上,在 rebase 的情况下,--ours 是上游,而 --theirs 是你的本地更改。

关于Git:使用 git-merge-file 来解决使用他们/我们的冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17123951/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com