Git 更改项目名称而不删除和重新创建存储库中的项目

Git change a project name without deleting and recreating project in repository

我的 git 存储库中有一个名为 outbount 的项目,由于项目名称应更改为 outbound(发生拼写错误。),我更改了它并尝试提交和推送。但是当我要提交时,它显示旧项目已被删除并创建了新项目。我只需要更改文件夹名称。我怎样才能做到这一点?如果我的概念有误,请纠正我。

所以你有一个这种结构的回购协议:

ParentDir
  |- .git
  |- outbount

并且您想将 outbount 重命名为 outbound。您需要告诉 Git 您要重命名目录:

git mv outbount outbound
git commit -m "correct dir name typo"

就是这样。