10

.gitattributesファイルで次の行を見つけました

*.cs   text diff=csharp

どういう意味ですか?

4

3 に答える 3

8

これは、.cs(CSharp) ファイルの場合、git がtext diff=csharpマージ/差分モードとして使用することを意味します。

これにより、マージ中に git が成功する確率が高くなります。

また、次のように述べている gitattributes doc も参照してください。

Setting the text attribute on a path enables end-of-line normalization
and marks the path as a text file. End-of-line conversion takes place
without guessing the content type.

There are a few built-in patterns to make this easier,
and tex is one of them, so you do not have to write the above
in your configuration file (you still need to enable this with the attribute mechanism,
via .gitattributes). The following built in patterns are available:
[...]
csharp suitable for source code in the C# language.
于 2014-02-28T22:01:24.700 に答える
2

これは、すべての csharp コード ファイルに対してテキスト マージを使用するように git に指示します。

また、コミット言語固有の差分情報も作成します。これは、コミットのヘッダーを見ることで、差分が作成されたコードのメソッドを確認できることを意味します。

于 2014-02-28T22:32:49.680 に答える