<p>I'm not too sure what is going on here, but sometimes a particular file in my repository will change the case of its name. e.g.,:</p>
<p>before: <code>File.h</code></p>
<p>after: <code>file.h</code></p>
<p>I don't really care why this is happening, but this causes git to think it is a new file, and then I have to go and change the file name back. Can you just make git ignore case changes?</p>
<p><strong>[edit]</strong>
I suspect it is Visual Studio doing something weird with that particular file, because it seems to happen most often when I open and save it after changes. I don't have any way to fix bugs in VS however, but git should be a bit more capable I hope.</p>

[{'answer_id': 53116, 'author': 'MarkB', 'author_id': 2996, 'author_profile': 'https://Stackoverflow.com/users/2996', 'pm_score': 9, 'selected': True, 'text': '<p>Since version 1.5.6 there is an <code>ignorecase</code> option available in the <code>[core]</code> section of <code>.git/config</code></p>\n\n<p>e.g. add <code>ignorecase = true</code></p>\n\n<p>To change it for just one repo, from that folder run:</p>\n\n<pre><code>git config core.ignorecase true\n</code></pre>\n\n<p>To change it globally: </p>\n\n<pre><code>git config --global core.ignorecase true\n</code></pre>\n'}, {'answer_id': 535575, 'author': 'John C', 'author_id': 64794, 'author_profile': 'https://Stackoverflow.com/users/64794', 'pm_score': 4, 'selected': False, 'text': '<p>In git version 1.6.1.9 for windows I found that "ignorecase=true\' in config was already set by default.</p>\n'}, {'answer_id': 8094870, 'author': 'akauppi', 'author_id': 14455, 'author_profile': 'https://Stackoverflow.com/users/14455', 'pm_score': 3, 'selected': False, 'text': '<p>The situation described in the question is now re-occuring with Mac OS X, git version >= 1.7.4 (I think). The cure is to set your ignorecase=false and rename the lowercased files (that git changed that way, not Visual Studio) back to their UsualCase by hand (i.e. \'mv myname MyName\').</p>\n\n<p>More info <a href="http://tapestryjava.blogspot.com/2010/07/git-on-mac-os-x-dont-ignore-case.html" rel="noreferrer">here</a>.</p>\n'}, {'answer_id': 38288815, 'author': 'Andrew Arnott', 'author_id': 46926, 'author_profile': 'https://Stackoverflow.com/users/46926', 'pm_score': 4, 'selected': False, 'text': "<p>You can force git to rename the file in a case-only way with this command:</p>\n\n<pre><code>git mv --cached name.txt NAME.TXT\n</code></pre>\n\n<p>Note this doesn't change the case of the file in your checked out copy on a Windows partition, but git records the casing change and you can commit that change. Future checkouts will use the new casing.</p>\n"}, {'answer_id': 64270783, 'author': 'FoxDeploy', 'author_id': 1238413, 'author_profile': 'https://Stackoverflow.com/users/1238413', 'pm_score': 2, 'selected': False, 'text': '<p>To force git to recognize the change of casing to a file, you can run this command.</p>\n<ol>\n<li>Change the File casing however you like</li>\n<li><code>git mv -f mynewapp.sln MyNewApp.sln</code></li>\n</ol>\n<p>The previous command seems to be deprecated now.</p>\n'}, {'answer_id': 65411150, 'author': 'Mario', 'author_id': 14306183, 'author_profile': 'https://Stackoverflow.com/users/14306183', 'pm_score': 0, 'selected': False, 'text': '<ol>\n<li>From the console: git config core.ignorecase true</li>\n<li>Change file name capitalisation</li>\n<li>Commit</li>\n<li>From the console: git config core.ignorecase false</li>\n</ol>\n<p>Step 4 fixed problems checking out branches with a different capitalisation.</p>\n'}, {'answer_id': 68185614, 'author': 'Matthew Barbara', 'author_id': 3861691, 'author_profile': 'https://Stackoverflow.com/users/3861691', 'pm_score': 0, 'selected': False, 'text': '<p><code>git mv FileName fileNameTemp</code></p>\n<p>then</p>\n<p><code>git mv fileNameTemp fileName</code></p>\n<p>will solve your problem without the need to commit.</p>\n'}]
['https://Stackoverflow.com/questions/52950', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3146/']