美文网首页
使用git clone --depth 1后再切换其它分支方法

使用git clone --depth 1后再切换其它分支方法

作者: liuxingzi | 来源:发表于2024-04-18 16:38 被阅读0次

使用 git clone --depth 1, 可以只clone最后一次commit ,也只有一个master分支,如果这时还想切换到其它分支如何操作呢?

git remote set-branches origin 'remote_branch'
git fetch --depth 1 origin remote_branch
git checkout remote_branch

相关文章

  • git 常用

    clone 指定分支 git clone -b 分支名 http://xxx.git 切换分支 git check...

  • git clone 大文件

    1 2 3 LFS 4 depth 使用Git clone代码失败的解决方法 Git_Clone大项目超过1G失败...

  • Git常用命令

    git clone后,切换到远程分支: git checkout -b 2.0.0 origin/2.0.0 本地...

  • 因为提交太多导致git库太大,很难clone的解决方法

    逐步clone的方法 $ git clone --depth 1 https://github.com/doges...

  • 常用的Git命令

    Git命令 克隆代码:git clone 创建分支:git branch branchname 切换分支:git ...

  • Git

    1 克隆:git clone 仓库地址 2 切换分支:git checkout 分支名 3 查看状态:git s...

  • git 相关

    1,git clone .. 克隆远程分支到本地。 2,git checkout branchName 在本地切换...

  • git clone 后 切换分支

    1、进行clone 克隆后出现如下文件夹 2、进入文件夹 3、git 查看分支 一般使用git branch 在此...

  • git的一些日常操作

    1. git clone --depth=1当项目过大时,git clone时会出现error, 可以使用命令gi...

  • git 命令笔记

    git clone 克隆版本库 通过使用--branch确定要下载的分支 用--depth设定深度,可以较快速的下...

网友评论

      本文标题:使用git clone --depth 1后再切换其它分支方法

      本文链接:https://www.haomeiwen.com/subject/wkhyxjtx.html