Change case in filenames with Git

Over the weekend we had a pull request made for one of the SublimeText organisation plugins which contained a couple of commits that were done so that the read me file would change from to - it was like this:

  1. Renamed to
  2. Renamed to

Whilst there is nothing wrong with that, these commits can actually be compressed into one.

If you try to just run git mv Git will throw a lovely error.

fatal: destination exists,,  

We can actually override this behaviour by adding the --force flag. Warning: Always watch out when you force or change default behaviour like this. Don't do anything crazy.

So now git mv --force works perfectly.

Whilst technically yes, you could squish the commits you're rewriting history. Never rewrite history.

comments powered by Disqus