Without .gitattributes
, Git has to detect if a file is text or binary. If I add .gitattributes and specify the file is text, no detection is needed. I assume performance will increase a bit. Am I correct?
Asked
Active
Viewed 55 times
1

Gqqnbig
- 5,845
- 10
- 45
- 86
-
2In general, correctness is much more of a concern than time with git. What scenario do you have that requires you to optimize? – Mad Physicist Nov 17 '17 at 02:31
-
@MadPhysicist not really, I'm just learning git and thought of this implication. – Gqqnbig Nov 17 '17 at 02:34
-
[Premature optimization is the root of all evil](https://softwareengineering.stackexchange.com/a/80092/75264) – 1615903 Nov 17 '17 at 06:41
1 Answers
0
In theory, it could make lead to a slight performance boost. However, git only checks the first 8000 bytes of the file for null bytes (source), which would be quite fast.
So, sure, go for it! It's certainly not going to hurt, but you probably won't notice the difference unless you have a ridiculous number of files.

jhpratt
- 6,841
- 16
- 40
- 50