我有一个带有Components
文件夹的 git 存储库。此文件夹已重命名为,components
但由于该文件夹已经在存储库中,因此不会在原始存储库中重命名。
如何重命名原始存储库中的文件夹?
git mv <old name> <new name>
git commit "Componetens -> components"
git push
If you already renamed your folder, without telling git (through a proper git mv
), you can
git delete Components
git add components
git commit -m "rename Components folder to components"
git push
The trap is to add to the index a second folder "components
", which a case insensitive OS like Windows would have a hard time displaying, since it wouldn't be able to check out both "Components
" and "components
".