流浪のwolf

卷帝

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

克隆项目中的指定文件

ps:一般我们都是直接克隆整个的项目  使用 git clone 项目 url  

但是有的需求只需要某个文件 ;

1. 本地新建文件并和线上的项目关联 

git init 使用 git 接管文件 

 

https://blog.csdn.net/constant_rain/article/details/124913407?spm=1001.2101.3001.6650.1&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-1-124913407-blog-127177631.pc_relevant_vip_default&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-1-124913407-blog-127177631.pc_relevant_vip_default&utm_relevant_index=2

复制代码
      mkdir -p /use/dir
      
      cd /use/dir
      
      git init
      
      git remote add -f origin git@git.xxx.com:xxx/xxx.git
      
      git config core.sparsecheckout true
      
      echo "clone_file" >> .git/info/sparse-checkout
      
      git checkout maste
复制代码

 

posted on   朱龙旭的网络  阅读(23)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· Blazor Hybrid适配到HarmonyOS系统
· 支付宝 IoT 设备入门宝典(下)设备经营篇
· 万字调研——AI生成内容检测
· 解决跨域问题的这6种方案,真香!
· 一套基于 Material Design 规范实现的 Blazor 和 Razor 通用组件库
点击右上角即可分享
微信分享提示