Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to repair CRLF in GIT repository to avoid merge conflicts
    text
    copied!<p>I created my repo with <code>autocrlf=true</code> and then made some checkouts and commits with <code>autocrlf=false</code>. Then switched back to <code>autocrlf=true</code> (OS Win). Everything seemed to be OK, until I started some merges between branches. Many merge conflicts arose, where whole file was marked as changed due to changed <code>eols</code> (I suppose it were those files, which were checked out and commited with <code>autocrlf=false</code>). </p> <p>There is some history, which is worth for me, so I prefer to make some conversion or fixing commits with converted <code>eols</code> rather to creating new repo and starting new life. </p> <p>This is how I understand <code>autocrlf</code> (OS Win):</p> <p>case if <code>autocrlf=true</code></p> <pre><code>WorkingTree -&gt; commit -&gt; GITRepository CRLF CRLF to LF LF LF no conv. LF WorkingTree &lt;- checkout &lt;- GITRepository CRLF LF to CRLF LF </code></pre> <p>case if <code>autocrlf=false</code></p> <pre><code>WorkingTree -&gt; commit -&gt; GITRepository CRLF no conv. CRLF LF no conv. LF WorkingTree &lt;- checkout &lt;- GITRepository CRLF no conv. CRLF LF no conv. LF </code></pre> <p>Now I would like to use GIT with <code>autocrlf=false</code>, so I decided to checkout each branch, repair <code>eols</code> of source files with utility <a href="http://www.totato.com/eolconverter/" rel="nofollow noreferrer">EOL converter</a> and commit back with CRLF. I did it, but after time, there are still some files, which probably were not checked out after I changed setting of <code>autocrlf</code> to <code>false</code> (or these files came to merge from older not fixed commits? During conversion I used mask *.filetype to automate processing all LF to CRLF so there's no other explanation for such situation for me). I also tried to <code>touch</code> the files, to re-commit them all (as I saw somewhere here in stackoverflow) but date change is not relevant for GIT AFAIK. I have also read <a href="https://stackoverflow.com/questions/6117678/how-to-undo-the-damage-of-autocrlf">How to undo the damage of autocrlf</a>, but not sure it's my case, and also don't understand the wizard's tricks.</p> <p>How can I get away from this mess, please?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload