スタッシュを逆に適用するにはどうすればよいですか?という質問を見てきました。パット・ノッツの質問。そして、承認された回答を試しましたが、このようなエラーが発生し、
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 .
とコマンドを実行すると、次の情報が表示されます。sudo 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
stash が適用された後、このように私のファイルに競合があります。
<<<<<<< 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 .