linux - Fixing the line-endings in a Git repository using the `.gitattributes` file -
What's the need for fixing:
I have a I edit the file from some different computers, running a Linux and running a pair of Windows. I know that D To be able to open files in both OSs, as they should be displayed, and displays a I did something, read line-endings and tried to follow the Geet settings, and even the commands. As it stands, I have a I have tried (): and this (): Happy to provide more details on answering questions. Any ideas where I was going wrong? Do I miss a step? Try to just use in your .gitattributes. I had installed a small test repo with a CR-LF file and followed my first procedure to generalize: Correctly normalized file at check-in But, oddly, it is still CR- LF is kept out while checking out, even though I'm on OSX. It is believed that the default value for core.eol is original. So, I hope GIT can only check my files using LF. But it seems that for some reason, this is not just doing this, therefore, my understanding of gittiments is messy, or we have a bug to hit ... In any case, Clearly EOL = Country Setting Jitatites did the trick for me, as I said. .md File, which contains an essay that I am writing to.
Git diff Now in Windows, where I made some changes, I can show my essay as well as separate lines of text ... to be removed Everything has been replaced and replaced by a long line where the paragraphs
^ m s.
^ M refers to Windows' CLRF line end
Diff means that I have started the file (fully possible, I do not remember) in Linux and since then it has been saved in Windows and all The end of the line has been changed.
diff result, which shows the line breaks (
What I have tried:
.gitattributes file which is on the top-level repository which I have created myself for the repository. There are only two rows:
# These files are text and must be normalized (LF from Windows CLRF) * .md text
git rm --cached -r git reset - add hard git git commit -m "normal end line"
git rm --cached -r GIT config core.autocrollf input git intercache --name-only -z | In the second case, the last order tells me that there is nothing to commit. (I do not even like the idea of changing
core.autoclrf because I try to do it purely through
.gitattributes , but I'm frustrated I am.)
*. MD Text instead of EOL = Original
*. MD text
git rm --cached -r GIT Reset - Add hard GIT Git commit -m "Normal look the end of the line"
Comments
Post a Comment