简体   繁体   English

仓库的 Github 仓库名称和本地文件夹名称

[英]Github repo name and local folder name for repo

I have stored my app sources (git repo) in folder:我已将我的应用程序源 (git repo) 存储在文件夹中:

MyProject/front_app

But on GitHub I want to have the repo named not front_app but rather my_project_front_app , is it possible to do?但是在 GitHub 上,我想将 repo 命名为不是front_app而是my_project_front_app ,这可以吗?

Is it a good approach or it is better to have local folder my_project_front_app for this git repo?这是一个好方法还是更好地为这个 git repo 设置本地文件夹my_project_front_app

You can do what you want.你可以做你想做的。 The local and the remote repository can have different names.本地和远程存储库可以有不同的名称。

If you already have a local repository, you can add a remote (named as you want) with:如果您已经有一个本地存储库,您可以添加一个远程(根据需要命名):

git remote add origin http://distant/a_remote_repository

If you already have a GitHub repository, you can clone it in the local folder you want with:如果您已经有一个 GitHub 存储库,您可以将其克隆到您想要的本地文件夹中:

git clone http://distant/a_remote_repository a_different_local_folder

There is no reason the GitHub repository, your local clone, and any other copy of the code couldn't be named differently. GitHub 存储库、您的本地克隆和任何其他代码副本没有理由不能以不同的方式命名。 There's no real advantage or disadvantage to it, other than you and your collaborators' ability to keep it straight.除了您和您​​的合作者保持正直的能力之外,它没有真正的优势或劣势。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM