0

ここで興味深い出来事がありました。私はしばらくの間開発を行っており (Windows で開発し、ファイルを Linux VM に移動し、VM からコミットを行います)、多数の新しいファイルを作成しました。を実行するgit statusと、すべての新しいファイルがnew file:セクションとセクションの両方に表示されますmodified:

の結果は次のgit statusとおりです。

# On branch 2.x-merge
# Your branch is ahead of 'composer/2.x-merge' by 1 commit.
#
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       new file:   SP/ElasticSearch/ElasticSearch.php
#       new file:   SP/ElasticSearch/Filters/AndFilter.php
#       new file:   SP/ElasticSearch/Filters/Boolean.php
#       new file:   SP/ElasticSearch/Filters/OrFilter.php
#       new file:   SP/ElasticSearch/Queries/Boolean.php
#       new file:   SP/ElasticSearch/Queries/Filtered.php
#       new file:   SP/ElasticSearch/Queries/Match.php
#       new file:   SP/ElasticSearch/Queries/MatchAll.php
#       new file:   SP/ElasticSearch/Queries/Term.php
#       new file:   SP/ElasticSearch/esFilter.php
#       new file:   SP/ElasticSearch/esInserter.php
#       new file:   SP/ElasticSearch/esQuery.php
#       new file:   SP/ElasticSearch/esQueryBuilder.php
#       new file:   tests/SP/ElasticSearch/ESTest.php
#       new file:   tests/SP/ElasticSearch/esFilterTest.php
#       new file:   tests/SP/ElasticSearch/esQueryTest.php
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   SP/ElasticSearch/ElasticSearch.php
#       modified:   SP/ElasticSearch/Filters/Boolean.php
#       modified:   SP/ElasticSearch/Filters/OrFilter.php
#       modified:   SP/ElasticSearch/Queries/Boolean.php
#       modified:   SP/ElasticSearch/esFilter.php
#       modified:   SP/ElasticSearch/esQuery.php
#       modified:   SP/ElasticSearch/esQueryBuilder.php
#       modified:   build.xml
#       modified:   tests/SP/ElasticSearch/ESTest.php
#       modified:   tests/SP/ElasticSearch/esQueryTest.php
#

お気付きかもしれませんが、変更されたセクションに表示されるもの ( を除くbuild.xml) はすべて新しいセクションに表示されます。これらはすべて新しいファイルなので、そうあるべきです。

コミットはうまくいきました。私はちょうど実行しました-amが、問題はありませんでした。なぜこれが起こるのか、それが何を意味するのか、またはどのように起こるのかを誰かが知っているかどうか疑問に思っています.

前もって感謝します。

4

2 に答える 2

0

実行git diffして、ステージングされていない変更git diff --cachedを表示し、ステージングされた変更を表示します。

これらのファイルの行末を知らないうちに変更している可能性があります。Windows では、2 バイト (キャリッジ リターンとライン フィード) で行を終了することを好みます。Unix では、1 バイト (改行のみ) で行を終了することを好みます。

于 2013-05-14T23:20:37.083 に答える