zoukankan      html  css  js  c++  java
  • git clone 指定的单个目录或文件夹

    git clone 指定的单个目录或文件夹

    针对自己的项目

    方法一

    基于sparse clone变通方法

    • 创建一个空仓库
    • 拉取远程仓库信息
    • 开启 sparse clone
    • 设置过滤
    • 更新仓库

    创建空仓库

    mkdir devops
    cd devops
    git init  # 初始化
    

    拉取远程仓库信息

    git remote add -f origin http://your/git/repo.git  # 拉取远程仓库信息
    

    开启 sparse clone

    git config core.sparsecheckout true  # 开启 sparse clone
    

    设置过滤

    echo "devops" >> .git/info/sparse-checkout  # 设置过滤条件
    

    更新仓库

    git pull origin master # 拉取仓库
    

    方法二(可能没用)

    使用 svn

    • 打开对应目录
    • 将其 url 中的 /tree/master/ 更换为 /trunk/
    • 使用svn 下载
    文件的url: https: //github.com/Mooophy/Cpp-Primer/tree/master/ch03 ## 将/tree/master/
    换为 /trunk/ 
    
    svn checkout https://github.com/Mooophy/Cpp-Primer/trunk/ch03  
    
  • 相关阅读:
    计网 | 文件传输协议
    Java | JDK8 | Integer
    2.项目管理-应用工具
    1.需求管理
    1.短视频运营基础
    10.视频效果---变形稳定器
    9.时间重映射
    8.效果控件之移动&&缩放
    7.标记
    6.子剪辑与合并剪辑
  • 原文地址:https://www.cnblogs.com/xkus/p/9692842.html
Copyright © 2011-2022 走看看