网上大多数都是教你:

  1. 克隆最新一次 commit:git clone https://xxxxxx.git --depth 1
  2. 下载所有历史:git fetch --unshallow
  3. 设置分支:git remote set-branches origin '*'
  4. git fetch -v

但是 git fetch --unshallow 还是很大怎么办呢? 百度到此就 GG 了

  1. 克隆最新一次 commit:git clone https://xxxxxx.git --depth 1
  2. 设置分支:git remote set-branches origin *
  3. 拉取你想要的分支:git fetch --depth 1 origin xxx 或者使用 git pull --depth=1
  4. git branch -a

就这么简单,想要那个就拉取哪里分支的最新一次提交