BluePen BluePen
  • Jenkins
  • OS
  • 算法
随笔
分类
标签
归档
关于
留言板
GitHub (opens new window)

Alex

一个好人
  • Jenkins
  • OS
  • 算法
随笔
分类
标签
归档
关于
留言板
GitHub (opens new window)
  • 浅克隆
    • 浅克隆
    • 浅克隆更新
    • 参考
  • Git 子模块
  • Git FAQ
  • Git
Alex
2020-09-11
目录

浅克隆

-> 浅克隆

clone 时指定深度 --depth, 为 1表示只拉取最新的一次提交,丢弃掉历史提交记录

git clone <repo> --depth 1
1

-> 浅克隆更新

浅克隆的仓库后续更新,如果使用 pull依旧会拉取到历史提交。
如果像继续更新到最新的提交,可以做以下操作

git fetch --depth 1
git reset --hard origin/<branch_name>
git clean -dfx
1
2
3

-> 参考

  • how-to-update-a-git-shallow-clone (opens new window)
编辑此页 (opens new window)
更新于: 2020-09-11 18:05
Git 子模块

Git 子模块→

Copyright © 2019-2022 | yxxy | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式