标签 svn 下的文章

使用 svn 检出 GitHub 项目中的子目录

例如我们想检出 https://github.com/openwrt/packages 项目下的 net/nginx 子目录,但是不想把整个项目克隆下来。

可以利用 svn 来实现, svn 支持 --depth 选项,具体有 empty/files/immediates/infinity 四种参数,含义如下:

      depth-empty ------>  Updates will not pull in any files or
                           subdirectories not already present.
   
      depth-files ------>  Updates will pull in any files not already
                           present, but not subdirectories.
   
      depth-immediates ->  Updates will pull in any files or
                           subdirectories not already present; those
                           subdirectories' this_dir entries will
                           have depth-empty.
   
      depth-infinity --->  Updates will pull in any files or
                           subdirectories not already present; those
                           subdirectories' this_dir entries will
                           have depth-infinity.  Equivalent to
                           today's default update behavior.

1) 检出项目

svn co --depth=empty https://github.com/openwrt/packages/trunk packages

- 阅读剩余部分 -