开发者

Case typo on path in msysgit

开发者 https://www.devze.com 2023-01-05 19:18 出处:网络
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 c开发者_运维问答alled \"Domain\", I added them to \"DOma

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 c开发者_运维问答alled "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?


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


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 ;) )

0

精彩评论

暂无评论...
验证码 换一张
取 消