克隆 GitHub 存储库的内容(不包括文件夹本身) [英] Clone contents of a GitHub repository (without the folder itself)
问题描述
我想git clone
我在GitHub上的存储库的内容.当我 git clone
(git@github:me/name.git...) 我得到一个名为 name/
的文件夹和里面的名字我有我的内容......如何我只得到内容吗?
I'd like to git clone
the contents of a repository I have on GitHub. When I git clone
(git@github:me/name.git...) I get a folder called name/
and inside name I have my contents... How do I get JUST the contents?
推荐答案
如果当前目录为空,你可以这样做:
If the current directory is empty, you can do that with:
git clone git@github.com:me/name.git .
(注意末尾的 .
指定当前目录.)当然,这也会在您的当前文件夹中创建 .git
目录,而不仅仅是源来自您项目的代码.
(Note the .
at the end to specify the current directory.) Of course, this also creates the .git
directory in your current folder, not just the source code from your project.
这个可选的 [directory]
参数记录在 git clone
手册页,其中指出只有当该目录为空时才允许克隆到现有目录中.
This optional [directory]
parameter is documented in the git clone
manual page, which points out that cloning into an existing directory is only allowed if that directory is empty.
这篇关于克隆 GitHub 存储库的内容(不包括文件夹本身)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!