gpt4 book ai didi

git: fatal: '--ours/--theirs' 不能与切换分支一起使用

转载 作者:IT王子 更新时间:2023-10-29 01:30:54 32 4
gpt4 key购买 nike

在 merge 冲突中,我试图解决所有有利于特定分支的 merge 冲突。

我正在尝试执行 git checkout --ours,但出现以下错误:

fatal: '--ours/--theirs' cannot be used with switching branches

我怎样才能实现我想做的事情?

最佳答案

git checkout--ours--theirs 一起使用需要至少一个参数:文件的路径/要 checkout 的目录。

作为the manual说:

When checking out paths from the index, check out stage #2 (ours) or #3 (theirs) for unmerged paths.

所以:

git checkout --ours <path(s)>

关于git: fatal: '--ours/--theirs' 不能与切换分支一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40903599/

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