Git Clone

较大项目Clone

  1. 克隆最近一次提交

    • 进入需要存储位置目录
    git clone --depth=1 <https://www>.***.com/***.git
    
    • --depth=1命令后,只会拉取默认分支的最近一次提交,无法看到提交信息及其他分支
  2. 转换存储库为完整存储库

    • 进入项目目录
    git pull --unshallow
     
    #或者
     
    git fetch --unshallow
    
    • 非浅层转换为完整的存储库,消除浅层存储库所施加的所有限制
  3. 修改.git文件夹内config文件

    • 命令修改
    git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
    
    • 修改.git文件夹内config文件的[remote "origin"]节的内容
    • 手动调整,修改 fetch 部分就OK
    # 修改前
    [remote "origin"]
    url = <https://www>.***.com/***.git
    fetch = +refs/heads/master:refs/remotes/origin/master
    
    # 修改后
    [remote "origin"]
    url = <https://www>.***.com/***.git
    fetch = +refs/heads/*:refs/remotes/origin/*
    
  4. 获取所有分支

    git fetch -pv
    

使用Gitee库

Notion – The all-in-one workspace for your notes, tasks, wikis, and databases.A new tool that blends your everyday work apps into one. It's the all-in-one workspace for you and your teamhttps://serious-lose.notion.site/Git-Clone-787d12e4a11e46d7869be817e2b7dc57

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值