Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the value means in git?

In a .gitattributes file I found the following line

*.cs   text diff=csharp

what does it mean?

like image 431
Otto Barrows Avatar asked Feb 28 '14 21:02

Otto Barrows


1 Answers

It means that for .cs (CSharp) files, git will use text diff=csharp as the merge/diff mode.

This allows git to have a higher probability of success rates while merging.

Also see the gitattributes doc, which states:

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.

and

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.
like image 57
Uli Köhler Avatar answered Sep 27 '22 20:09

Uli Köhler