1.拉取默认分支
git clone --depth 1 地址
2.获取 远程分支 (使用 git branch-r,git remote update origin --p失效)
git ls-remote origin
3.设置远程分支
git remote set-branches origin 'remote_branch_name'
4.拉取分支
git fetch --depth 1 origin remote_branch_name
5.切换分支
git checkout remote_branch_name
6.重新拉取之前的记录
git pull --unshallow
本文详细介绍了如何使用Git进行默认分支克隆、远程分支操作、设置及拉取,包括git clone、git branch、git remote set-branches、git fetch和git pull等技巧,以及如何重新获取历史记录。
2409

被折叠的 条评论
为什么被折叠?



