gpt4 book ai didi

Git Tower 无法重新应用存储 : Conflicts in index

转载 作者:行者123 更新时间:2023-12-05 03:06:43 26 4
gpt4 key购买 nike

在 Git Tower 内部,我存储了大约 26 个文件。但是,当我尝试将存储应用回我的工作树时,我收到有关尾随空格的错误。

我怎样才能成功应用存储,绕过该错误?

完整的错误信息如下:

<stdin>:87: trailing whitespace.
// query code
<stdin>:88: trailing whitespace.
// query code
<stdin>:104: trailing whitespace.
// query code
<stdin>:118: trailing whitespace.
// query code
<stdin>:119: trailing whitespace.
//error code
error: patch failed: app/Http/Controllers/ProjectController.php:43
error: app/Http/Controllers/ProjectController.php: patch does not apply
error: patch failed: resources/views/projects/filter.blade.php:1
error: resources/views/projects/filter.blade.php: patch does not apply
Conflicts in index. Try without --index.

最佳答案

Conflicts in index. Try without --index.

这意味着您尝试了 git stash apply --index 并且在 Git 尝试应用 stash 的补丁时发生了冲突。当 Git 遇到冲突时,冲突的状态被存储在索引中,以防止你不小心提交 Unresolved 冲突,并提醒你首先真正解决那些冲突。因此,当 Git 需要这些冲突的索引时,显式恢复 stash 的索引状态将失败。

这也解释了in the documentation :

If the --index option is used, then tries to reinstate not only the working tree’s changes, but also the index’s ones. However, this can fail, when you have conflicts (which are stored in the index, where you therefore can no longer apply the changes as they were originally).

因此,正如错误消息所暗示的那样,解决方案是使用不带 --index 的命令。

如果 Git Tower 自动为您执行此操作,那么您可能必须在此处从命令行恢复存储。

关于Git Tower 无法重新应用存储 : Conflicts in index,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48916371/

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