jhnwsk
jhnwsk

Reputation: 953

How to change the behavior of git status showing modified files which are eventually not committed?

I am working in a windows-only working environment with developers using all kinds of tools to edit their files. We are using .git along with the atlassian stack to version our code. I like almost all of it.

I have just recently finished fighting a long and hard fight to wrap my head around how and why git interprets line endings and what core.autocrlf does. We've decided to use core.autocrlf true and all is almost well.

I would LOVE to know how to change this behavior of git status:

To this one:

Is this possible?

I believe the possible duplicate does not hold the answer I am looking for. I would like to emphasize that I do (think I) know what my setting core.autocrlf true does and want to keep it that way. What I'm interested in is either not detecting changes in git status which will not be committed anyway, or understanding why this is not possible.

Upvotes: 8

Views: 392

Answers (1)

Chananel P
Chananel P

Reputation: 1814

When you set core.autocrlf true all files in your working directory will have CRLF line ending (regard less of the actual line ending in the repository). For most windows users this is good enough.

From your question I understand you want to have your working directory files (=local file) with LF. So, here you should be using core.autocrlf input. This will give you the exact line ending as in the repository (but still it will make sure all check-ins are made with LF).

Read more about the difference of true, false, input in this answer.

Upvotes: 1

Related Questions