切换到宽版
  • 4053Read
  • 0Replay

如何github网站上下载单个文件夹? [复制链接]

上一主题 下一主题
离线Francis
 

只看楼主 倒序阅读 使用道具 楼主  posttime: 2016-06-16
— 本帖被 Francis 从 Linux--Ubuntu/Git 移动到本区(2017-10-16) —
http://stackoverflow.com/questions/7106012/download-a-single-folder-or-directory-from-a-github-repo



This is a pretty old question, but I figured this out today and Ithought I'd leave this here for anyone else who has the same problem.
As all the previous answers have already noted, you are not allowedto download a single folder using Git. However, you ARE allowed to dothis with subversion. This won't work on a regular git repo obviously,but if you're using GitHub you can actually check out using svn.
For example:svn checkout https://github.com/foobar/Test/trunk/foo
trunk corresponds to master branch. You can use svn lsto see available tags and branches before downloading if you wish. Ifyou want a folder in a branch other than master then replace trunk with branches/branchname.
As of this writing, you can find the subversion URL for any repo onGitHub by clicking on "Subversion" at the bottom of the right sidebar.See GitHub's post on subversion partial checkouts for more info.
快速回复
限100 字节
如果您在写长篇帖子又不马上发表,建议存为草稿
 
上一个 下一个