如何给git repo命名? [英] How to give a git repo a name?
问题描述
我正在使用这些命令进行远程回购
I am making a remote repo by using these command
mkdir NewRepo
cd NewRepo
git init
然后我将此仓库克隆到本地
Then I clone this repo to local
git clone user@server:/path/to/app/.git
这对我有用,但是我想给仓库一个名字,像其他人一样做:
This worked for me, But I want give the repo a name, do something like everybody else does:
git clone user@server:/path/to/app/reponame.git
有人可以告诉我该怎么做吗?
Is there anyone who can tell me how to do this?
推荐答案
可以直接在文件夹中创建git存储库,而无需创建子目录 .git
.为此,请执行以下操作:
It is possible to create a git repository directly in a folder, without the subdirectory .git
. To do this, you do this:
mkdir myrepo.git
cd myrepo.git
git init --bare
这称为裸存储库-它包含通常在 .git
文件夹中的内容.没有工作副本.这些类型的存储库通常用于远程服务器(在其中推送更改).即,当您的远程存储库基本上反映了您在本地提交的内容,并且没有人直接在远程服务器位置中的代码上工作时(因此不需要工作副本.)
This is called a bare repository - it contains the contents of what would normally be in a .git
folder. It has no working copy. These sorts of repositories are usually used in the remote server (where you're pushing your changes); i.e., when your remote repository basically reflects what you've committed locally, and nobody is working directly on the code in the remote server location (therefore no need for a working copy.)
更多细节:
这篇关于如何给git repo命名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!