0

の出力はgit diff、1 つの my ファイルの完全な内容が削除されてから追加されたことを示しています。どうしてこれなの?

diff --git a/templates/appengine/go/app.yaml b/templates/appengine/go/app.yaml
index 303af12..223b642 100644
--- a/templates/appengine/go/app.yaml
+++ b/templates/appengine/go/app.yaml
@@ -1,13 +1,13 @@
-# Right now, we direct all URL requests to the Go app we are about to
-# construct, but in the future we may add support for jQuery and Bootstrap
-# to automatically put a nice UI on the / url.
-
-application: {{ app_id.downcase }}
-version: 1
-runtime: go
-api_version: 3
-
-handlers:
-- url: /.*
-  script: _go_app
-
+# Right now, we direct all URL requests to the Go app we are about to
+# construct, but in the future we may add support for jQuery and Bootstrap
+# to automatically put a nice UI on the / url.
+
+application: {{ app_id.downcase }}
+version: 1
+runtime: go
+api_version: 3
+
+handlers:
+- url: /.*
+  script: _go_app
+
4

2 に答える 2

2

この種のgit diff出力は、行末を変換した場合に予想されます(たとえば、Windowsで実行されている動作の悪いエディターを使用してUnixスタイルの行末を使用すると、LF->CR LF変換になります)。これは、空白を変更せずにファイルのすべての行を変更する一般的な方法です。空白は通常、生の差分出力から端末に解読できません。

のオプション-wは、空白の変更git diffを無視します。git diffあなたの場合はgit diff -wどのようになりますか?変化が見られない場合は、空白が出力の理由です。

このような場合、出力で文字が文字に変更されていることgit diff | tr '\r' '~'を確認できます(Unixツールが使用可能であると想定)。CR'~'git diff

于 2012-05-21T07:41:34.427 に答える
0

あるコミットで削除されてから追加されたため、それが表示されます。そのため、現在の状態と最後のコミットの違いが変わりました。

于 2012-05-03T04:23:57.467 に答える