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
:
- I have a file with
CRLF
line endings. I change the line endings to
LF
$ git status On branch somebranch Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: Src/the_file_i_changed_to_LF.js
But then...
$ git commit -a warning: LF will be replaced by CRLF in Src/the_file_i_changed_to_LF.js. The file will have its original line endings in your working directory. On branch somebranch nothing to commit, working directory clean
To this one:
- I have a file with
CRLF
line endings. I change the line endings to
LF
$ git status On branch somebranch nothing to commit, working directory clean
- which makes sense since nothing will get committed anyway.
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.