3

git statusいくつかのファイルが変更されていることがわかります。しかし、git diff以下のパラメーターのいずれかで実行すると、空になります。

   --ignore-space-at-eol
       Ignore changes in whitespace at EOL.

   -b, --ignore-space-change
       Ignore changes in amount of whitespace. This ignores whitespace at line end, and considers all other sequences of one or more whitespace characters to be equivalent.

   -w, --ignore-all-space
       Ignore whitespace when comparing lines. This ignores differences even if one line has whitespace where the other line has none.

この変更をリセットしようとしましgit checkout .たが、役に立ちません。このファイルを元の状態にロールバックする (「変更」されないようにする) か、git status空白の変更を永久に無視するにはどうすればよいですか?

git reset --hardも機能していません。

4

2 に答える 2

3

現在の git リポジトリのすべての変更を破棄する場合

使用する、git checkout -- .

追跡されていないファイルを使用している場合は、クリーニングする必要があるファイルを確認してくださいgit clean -n

ノート:

これにより、コミットgit reset --hardされていないすべてのファイルが削除されます。変更は永久に失われます (元に戻すことはできません)。

于 2014-09-04T07:05:20.850 に答える