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

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

问题描述

我希望 git clone 存储库中的内容 GitHub的的。当我 git clone (git @ github:me / name.git ...)时,我得到一个名为 name / 和内部名称我有我的内容...如何获得只是内容?

解决方案

如果当前目录为空,你可以这样做:

  git clone git @ github:me / name.git。 

(请注意 )当然,这也会在当前文件夹中创建 .git 目录,而不仅仅是项目的源代码。



这个可选的 [目录] 参数记录在 git clone 手册页,它指出只有当该目录为空时才允许克隆到现有目录。 p>

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:me/name.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.

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天全站免登陆