views:

24

answers:

2

I went out to my github repo and discovered that I had inadvertently added files to msysgit with a typo. Instead of adding files to a directory called "Domain", I added them to "DOmain".

I tried git mv, but the path is case-insensitive in Windows and the move fails.

What's the best way to resolve an issue like this?

+2  A: 

mv to something else, like "tempdir", and then mv back to the proper capitalization?

Amber
I resolved it through a standard mv while inside the typoed directory and right back into the properly typed name:TYpoedDir$git mv -f file ../GoodDir/file.Did a git add on the file from the GoodDir and confirmed using git ls-files. All good. Thanks, everyone.
Kurt Johnson
added add'l comment on ls-files
Kurt Johnson
A: 

Go back in history (git checkout someHash), create new dir with proper case, checkout the files from the wrong commit (git checkout someWrongHash someFiles), commit them, and then, reset HEAD to the new commit.

(And next time, don't torture youreslf with git on Windows ;) )

takeshin