克隆 GitHub 存储库的内容(不包括文件夹本身) [英] Clone contents of a GitHub repository (without the folder itself)

查看:30
本文介绍了克隆 GitHub 存储库的内容(不包括文件夹本身)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆