当我使用
git stash apply
时,出现了合并冲突。 我该如何使用stash进行硬覆盖文件?类似这样的操作。git stash apply -Xours
git stash apply
时,出现了合并冲突。 我该如何使用stash进行硬覆盖文件?类似这样的操作。git stash apply -Xours
git stash pop
和git stash apply
没有提供自动解决冲突的方法。git stash pop
文档中可以得知:git stash drop
。git checkout
快速解决冲突,选择其中一边。在您的情况下,您只需在git checkout
命令还可以带有--ours
和--theirs
选项,这是一个非常快速的方式,只需选择其中一侧,而无需合并任何内容。
git stash apply
之后运行此命令即可:git checkout --ours -- /path/to/conflicting/file