我加入交互文件:編輯git的補丁提供了「修改過的猛男不適用」
git add ../../template/panels/panel-reports.php -p
diff --git a/template/panels/panel-reports.php b/template/panels/panel-reports.php
index 5482228..48d2901 100644
--- a/template/panels/panel-reports.php
+++ b/template/panels/panel-reports.php
@@ -214,6 +214,8 @@
<a class="addCategory"></a>
<a class="removeCategory"></a>
+ <a class="addDocument"></a>
+ <a class="checkTool"></a>
<div class="categoriesList"></div>
<div class="documentsList"></div>
Stage this hunk [y,n,q,a,d,/,e,?]? e
PS:那些是這裏唯一的修飾線條
我想刪除
+ <a class="checkTool"></a>
所以我編輯是這樣的:
# Manual hunk edit mode -- see bottom for a quick guide
@@ -214,6 +214,7 @@
<a class="addCategory"></a>
<a class="removeCategory"></a>
+ <a class="addDocument"></a>
<div class="categoriesList"></div>
<div class="documentsList"></div>
# ---
# To remove '-' lines, make them ' ' lines (context).
# To remove '+' lines, delete them.
# Lines starting with # will be removed.
和Git拒絕了:
error: patch failed: template/panels/panel-reports.php:214
error: template/panels/panel-reports.php: patch does not apply
Your edited hunk does not apply. Edit again (saying "no" discards!) [y/n]?
對我來說,我沒有看到我寫的任何錯誤或歧義,所以我在哪裏錯了?
確保每個上下文行以前導空格字符「'開頭,即使該行是空的。 – ydroneaud 2012-02-29 16:33:42
已瀏覽[此問題](http://stackoverflow.com/questions/3268596/git-add-interactive-your-edited-hunk-does-not-apply)。 – simont 2012-02-29 21:08:34