较大项目Clone
-
克隆最近一次提交
- 进入需要存储位置目录
git clone --depth=1 <https://www>.***.com/***.git
- --depth=1命令后,只会拉取默认分支的最近一次提交,无法看到提交信息及其他分支
-
转换存储库为完整存储库
- 进入项目目录
git pull --unshallow #或者 git fetch --unshallow
- 将
非浅层转换为完整的存储库,消除浅层存储库所施加的所有限制
-
修改.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/*
-
获取所有分支
git fetch -pv