如何从github下载目录

时间:2015-01-29 23:11:38

标签: github

现在我知道在溢出时有几个这样的问题,但是这些答案中有几个对我来说是悲惨的。我正在使用Cygwin,如果它是相关的。我跑了

svn export https://github.com/Wikia/app/tree/dev/extensions/wikia/AdminDashboard

收到结果:

svn: E170000: URL 'http://github.com/Wikia/app/tree/dev/extensions/wikia/AdminDashboard' doesn't exist

我也跑了

curl -L http://github.com/Wikia/app/tree/dev/extensions/wikia/AdminDashboard > project.tar.gz

接收.tar.gz文件,7-Zip无法读取给出错误的文件:

enter image description here

1 个答案:

答案 0 :(得分:0)

两个评论:

  • GitHub repo不适用于svn命令
  • 网址不存在。

GitHub回购是完整的克隆,但您可以sparse checkoutin this gist执行this article

新存储库

mkdir <repo> && cd <repo>
git init
git remote add –f <name> <url>
git config core.sparsecheckout true
echo some/dir/ >> .git/info/sparse-checkout
echo another/sub/tree >> .git/info/sparse-checkout
git pull <remote> <branch>

现有存储库

git config core.sparsecheckout true
echo some/dir/ >> .git/info/sparse-checkout
echo another/sub/tree >> .git/info/sparse-checkout
git read-tree -mu HEAD
  

如果您以后决定更改要检出的目录,   只需编辑sparse-checkout文件,然后再次运行git read-tree

相关问题