12

我已将我的应用程序源(git repo)存储在文件夹中:

MyProject/front_app

但是在 GitHub 上,我希望将 repo 命名为 not front_appbut rather my_project_front_app,有可能吗?

这是一个好方法还是更好地my_project_front_app为这个 git repo 提供本地文件夹?

4

2 回答 2

24

你可以做你想做的。本地和远程存储库可以有不同的名称。

如果您已经有一个本地存储库,则可以添加一个远程(根据需要命名):

git remote add origin http://distant/a_remote_repository

如果你已经有一个 GitHub 存储库,你可以将它克隆到你想要的本地文件夹中:

git clone http://distant/a_remote_repository a_different_local_folder
于 2012-08-21T19:59:34.027 回答
2

没有理由不能以不同的方式命名 GitHub 存储库、您的本地克隆和任何其他代码副本。除了您和您​​的合作者保持直截了当的能力之外,它没有真正的优势或劣势。

git clone <url> <path> ;# path is a variable; it's the url that's well-defined
git remote add <name> <url> ;# as can be seen in the 'git remote add' command
于 2012-08-21T19:59:30.233 回答