Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I agree with Richard that this <em>could</em> stem from a case sensitivity/insensitivity problem. I will address that issue with this answer.</p> <p><strong>Problem</strong></p> <p>If a git commit contains two files whose names differ only in case, checking out that commit to a working directory in a case-insensitive filesystem causes problems. If the commit contains, for example, <code>myfile</code> and <code>myFILE</code>, git will create <code>myfile</code>, and then when it goes to create/update <code>myFILE</code>, the filesystem gives it a handle to <code>myfile</code>.</p> <p>This becomes apparent if myfile and myFILE have different contents in the repository. When checking out the files, the second one "wins" and the physical file contains the contents of the second file. When you do <code>git status</code>, the two files in the index both get compared to the same file in the working directory, and for the losing file, the contents don't match.</p> <p><strong>Verifying the Problem</strong></p> <p>You could checkout the repository on a case-sensitive system to analyze and resolve everything there. Alternatively, git does provide enough tools to deal with this on your current system.</p> <p>The easy way to see if this is really the problem, is to make a trivial modification to one of files listed. Then, running <code>git status</code> should show both variants of the filename, since the working dir version does not match either version in the index:</p> <pre><code>$ echo &gt;&gt; public/javascripts/app/fckeditor/fckpackager.xml $ git status Possible outcome: # On branch master # Changes not staged for commit: # (use "git add &lt;file&gt;..." to update what will be committed) # (use "git checkout -- &lt;file&gt;..." to discard changes in working directory) # # modified: ... # modified: public/javascripts/app/fckeditor/fckpackager.xml # modified: public/javascripts/app/fckeditor/FCKPACKAGER.xml </code></pre> <p>Or, you can also use <code>git ls-files</code> to see what's in the index:</p> <pre><code>$ git ls-files public/javascripts/app/fckeditor/fckpackager.xml public/javascripts/app/fckeditor/fckpackager.xml public/javascripts/app/fckeditor/FCKPACKAGER.xml </code></pre> <p>If you want to see exactly what is in each file, you can use <code>git checkout-index</code> to pull a file out of the index and save it somewhere (using a prefix so contents are written to separate files):</p> <pre><code>$ git checkout-index --prefix=v1/ public/javascripts/app/fckeditor/fckpackager.xml $ git checkout-index --prefix=v2/ public/javascripts/app/fckeditor/FCKPACKAGER.xml </code></pre> <p><strong>Resolution</strong></p> <p>Once you have figured out which variant of each file you want to remove, you can remove it from the index using <code>git rm --cached</code>, which respects the case of the paths given to it:</p> <pre><code>$ git rm --cached public/javascripts/app/fckeditor/FCKPACKAGER.xml </code></pre> <p>then commit, and if necessary do another <code>git reset --hard</code></p> <hr> <p>However, your comment about logging in as a different user and getting different result indicates there might be a different problem. That being the case I would see if there are any differences in the user-specific .gitconfig files.</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