-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"warning: LF will be replaced by CRLF in myFile" when using core.autocrlf? #1242
Comments
2 comments:
In your case there are no CRLF to be converted at commit time. Comment 2: |
@kiewic you still there? |
Hi guys, thank you for your response. I still feel this message is confusing, the message could be extended to include a better explanation of the issue, for example: "LF will be replaced by CRLF in file.json after removing the file and checking it out again". Also, the following line makes more difficult to understand what does the warning mean: "The file will have its original line endings in your working directory." This is true for the current file, but it is false for the situation the warning is describing. In addition, I see two buttons on the Using a .gitattributes file apparently does not suppress the warnings. I do create repositories very frequently, and I rarely create a .gitattributes file, so I think it would be greater if the root issue could be addressed. Here is the content of my .gitattributes file:
Should it contain something else? Thank you. |
As a quick workaround (because I really have no time to spare to help you, unfortunately!), you could create a |
Since I am using Windows, I tried creating the file at I understand you guys are very busy and I appreciate all your help. I simply wanted to brought up the issue for discussion and pseudo-documentation. Now I know how to interpret these warnings, and for now I can keep pressing the Thank you. |
I would suggest to take out .json files from CRLF conversion. .gitattributes looks like this: |
@kiewic did that help? |
Do you mean if |
@kiewic any chance you have |
Hi @whoisj,
But then I tried |
Great to see it worked out! |
Hi, I reinstalled my computer, and this configuration stopped working. I installed Doing Doing |
@kiewic try running |
Thanks for the report -
unfortunatly this feature doesn't work in 2.18.0.windows.1 - sorry for that.
A fix is already in upstream Git.
It didn't make it into 2.18, so it will be part of 2.19
…On Thu, Jul 19, 2018 at 10:45:24PM -0700, Gilberto Stankiewicz wrote:
Hi, I reinstalled my computer, and this configuration stopped working. I installed `git version 2.18.0.windows.1`, thought I have also tried `git version 2.17.1.windows.1`.
Doing `git config core.safecrlf false` does not prevent the `warning: LF will be replaced by CRLF in mapbox-search-tool/package-lock.json. The file will have its original line endings in your working directory` pop-up windows anymore (and this is what I want).
Doing `git config core.safecrlf true` stills makes the warning a fatal error.
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#1242 (comment)
|
@tboegi can you identify the fix more specifically? I can cherry-pick stuff into Git for Windows' master, you know 😃 |
@dscho : That would be nice: commit 6cb0912 (junio/as/safecrlf-quiet-fix)
|
When using `core.autocrlf`, the bogus "LF will be replaced by CRLF" warning [is now suppressed](git-for-windows/git#1242). Signed-off-by: Johannes Schindelin <[email protected]>
I can confirm that |
Setup
defaults?
to the issue you're seeing?
I have core.autocrlf enabled:
Details
CMD
Minimal, Complete, and Verifiable example
this will help us understand the issue.
Some tools create files with LF endings. And I have core.autocrlf enabled. When I add a file to a commit, I see the following warning:
It is not clear where it is going to be converted to CRLF, because the core.autocrlf option is suppose to convert CRLF endings to LF when committing a file. I was wondering if it means the file will be converted right away to CRLF in my working directory (in case the first line of the warning is disconnected from the second line), but that is not the case either.
This warning is confusing, and it is specially annoying when using
git gui
because I need to click theUnlock Index
button for every file.I did not expect to see this warning, specially because adding a file to a commit is supposed to do the opposite. I think it should say "CRLF will be replaced by LF"
I am not sure, it seems nothing happens.
URL to that repository to help us with testing?
No specific repository.
The text was updated successfully, but these errors were encountered: