error: ... patch does not apply
tldr:ハンクを編集して行を削除すると、動作するように見えるのになぜ取得するのですか?
実行中にハンクを編集していますgit add -p
が、追加するだけですnew line 1
(追加しないでくださいnew line 2
):
# Manual hunk edit mode -- see bottom for a quick guide
@@ -1 +1,3 @@
first line
+new line 1
+new line 2
# ---
# To remove '-' lines, make them ' ' lines (context).
# To remove '+' lines, delete them.
# Lines starting with # will be removed.
+
をのスペース
に変更しましたnew line 2
:
# Manual hunk edit mode -- see bottom for a quick guide
@@ -1 +1,3 @@
first line
+new line 1
new line 2
# ---
# To remove '-' lines, make them ' ' lines (context).
# To remove '+' lines, delete them.
# Lines starting with # will be removed.
しかし、それはエラーを与えます:
error: patch failed: myfile:1
error: myfile: patch does not apply
Your edited hunk does not apply. Edit again (saying "no" discards!) [y/n]?
何が問題ですか?