0

Windows で Git を使用していくつかのファイルをチェックインしています。のような警告を受けました。

LF は foobar で CRLF に置き換えられます

この警告はどういう意味ですか? この警告を防ぐために何かできますか。

4

3 に答える 3

0

それはcore.autocrlfオプションに関係しています。マニュアルには次のように書かれています。

   core.autocrlf
       Setting this variable to "true" is almost the same as setting the
       text attribute to "auto" on all files except that text files are
       not guaranteed to be normalized: files that contain CRLF in the
       repository will not be touched. Use this setting if you want to
       have CRLF line endings in your working directory even though the
       repository does not have normalized line endings. This variable can
       be set to input, in which case no output conversion is performed.

Git は、彼が行末記号を変更したことを警告します。

プロジェクトのグローバル ポリシー (「常に UNIX の行末を使用する」またはその逆など) を設定し、このオプションを無効にすることをお勧めします。時々物事が乱雑になり、差分をコミットすると、余分な空白の変更がたくさん含まれます。

于 2013-02-09T02:52:34.603 に答える
0

msysgit のデフォルトのシステム構成は ですcore.autocrlf = true。これは、CRLF 変換がオンであることを意味します。

于 2013-02-09T03:13:32.307 に答える
0

おそらく、行末が LF のファイルを追加しようとして、core.autocrlfオンになっていることを意味します。ファイルを CR/LF 行末に変換するか、オフにしcore.autocrlfます。

また、ここここここなど。

于 2013-02-09T22:34:01.720 に答える