I work in a production environment only for windows, and developers use all kinds of tools to edit their files. We use .git along with atlassian glass for the version of our code. I like almost all of this.
I recently ended up fighting a long and hard fight to wrap my head around how and why git interprets line endings and what core.autocrlf does. We decided to use core.autocrlf true , and all this is almost good.
I LOVE to know how to change this git status behavior:
- I have a file with a
CRLF line ending. I change 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
For this:
- I have a file with a
CRLF line ending. I change line endings to LF
$ git status On branch somebranch nothing to commit, working directory clean
- which makes sense, because in any case nothing will be done.
Is it possible?
I believe the possible duplicate does not contain the answer I'm looking for. I would like to emphasize that I (I think) know what my installation of core.autocrlf true does and wants to keep it that way. I'm interested in either not detecting changes in git status , which in any case will not be fixed, or understanding why this is not possible.
git windows core.autocrlf end-of-line
jhnwsk
source share