从git仓库下载 单个文件或者文件夹

转载自:https://www.cnblogs.com/yaolaoer/p/14564985.html


  1. 下载单个文件到压缩包:aab.zip
    git archive --remote=ssh://gerrit.mot.com:29418/scm_tools/odm_tools sandbox/abc/master create_pointline_views_with_jobs.py --output=aab.zip
    git archive --remote=ssh://gerrit.mot.com:29418/scm_tools/odm_tools sandbox/abc/master create_pointline_views_with_jobs.py | tar -xO > create_pointline_views_with_jobs.py
  2. 下载一个目录至压缩包:job_templates.zip
    git archive --remote=ssh://gerrit.mot.com:29418/scm_tools/odm_tools sandbox/abc/master job-templates/ --output=job_templates.zip
posted @ 2025-02-08 11:23  山村放羊娃  阅读(82)  评论(0)    收藏  举报