Just committing a. If we happen to develop on a Windows machine both files will have CRLF ending and if we develop on Linux or mac they will have LF when they will be committed. Then we add a. Unfortunately, the files would continue to have the original line ending that they had when they were committed. The fastest way to refresh them would be to delete and reset them. That can happen with the commands below.
This answer seems relevant since the OP makes reference to a need for a multi-OS solution. This Github help article details available approaches for handling lines endings cross-OS. There are global and per-repo approaches to managing cross-os line endings. In the root of your repo, create a. The text value can be configured further to instruct Git on how to handle line endings for matching files:. More on how to refresh your repo after changing line endings settings here.
Save your current files in Git, so that none of your work is lost. In some cases, this is all that needs to be done. Others may need to complete the following additional steps:. Add all your changed files back, and prepare them for a commit.
This is your chance to inspect which files, if any, were unchanged. It will display the files which are not added to the commit list and were modified after ignoring differences in line endings.
You can add the argument "add" to add those files to your commit. I use both windows and linux, but the solution core. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams?
Collectives on Stack Overflow. Learn more. Asked 8 years, 1 month ago. Active 5 months ago. Viewed k times. How do I make git status ignore line ending differences? Background info: I use randomly Windows and Linux to work on the project. The project is in Dropbox. If you download a file to your system from a different OS. You might notice that some weird behaviors occurs while processing the strings. Probably it is a result of inconsistency between text and OS.
For Ubuntu users, you can simply use file command to see the files line ending format. If you are working on cross-platform projects , the subtle difference above could be incredibly annoying; many editors on Windows silently replace existing LF-style line endings with CRLF, or insert both line-ending characters when the user hits the enter key.
I had a quick look at the code only from phone but couldn't spot any obvious interaction between. The next step would be to try to reproduce here.
In the meantime, can you perhaps answer the following questions:. In case there is confidential information in it you don't like to sure, make sure you at least keep everything with starting with core. Do you have any. Or is e. Can you perhaps provide the output of git ls-files --eol in both repos, one imported with. Sorry, something went wrong.
It would be possible to add it because it is testing project, but there is no useful information in it. I can reproduce here. What is also interesting is that both git config have core.
0コメント