我已经看到了如何反向应用存储的问题?Pat Notz问道。我已经尝试了批准的答案,但我收到了这样的错误,
sudo git stash show -p | git apply --reverse
error: patch failed: app/controllers/CloudController.php:673
error: app/controllers/CloudController.php: patch does not apply
error: patch failed: app/controllers/CloudGcode.php:1
error: app/controllers/CloudGcode.php: patch does not apply
我必须解释一下我是如何在这种情况下跑步的。我的存储列表中有一个存储,并且我在我的工作存储库中做了一些修改。我的工作存储库中的更改与 stash@{0} 冲突。然后我错误地执行git add .
andsudo git stash apply
命令,它显示了这个信息,
sudo git stash apply
[sudo] password for xxxx:
Auto-merging app/controllers/CloudGcode.php
CONFLICT (add/add): Merge conflict in app/controllers/CloudGcode.php
Auto-merging app/controllers/CloudController.php
CONFLICT (content): Merge conflict in app/controllers/CloudController.php
存储应用后,我的文件中存在这样的冲突,
<<<<<<< Updated upstream
for($i = 0; $i < $textlen; $i++)
{
$char = $uchars[$index++];
if($char !== 0)
$text = $text.chr($char);
}
$this->text = $text;
Log::info('LLLLLLLLLLLLLLLLLLLL'.$text);
=======
for($i = 0; $i < $this->textlen; $i++)
$text = $text.$uchars[$index++];
$this->text = $text;
$this->text[$this->textlen] = 0; // Terminate string overwriting checksum
>>>>>>> Stashed changes
$this->waitUntilAllCommandsAreParsed = true; // Don't destroy string until executed
}
$this->formatErrors = 0;
return true;
}
<<<<<<< Updated upstream
=======
然后我谷歌如何恢复它。我提出问题如何反向应用存储?Pat Notz问,并尝试了该问题的解决方案。我想知道有没有办法在执行之前sudo git stash apply
、之后或之前恢复状态git add .