1、克隆远程仓库
git clone /xxx/xxx.git
2、查看分支
git branch -a* masterremotes/origin/HEAD -> origin/masterremotes/origin/last_hardremotes/origin/master
3、将本地分支与远程保持同步
git fetch
4、新建本地分支,名称与远程仓库分支名称一致,并同步远程分支
git checkout -b last_hard origin/last_hard
5、同步所有远程分支
git branch -r | grep -v ‘->’ | while read remote; do git branch --track “KaTeX parse error: Expected '}', got '#' at position 8: {remote#?origin/}" "remote”; done
6、将本地所有分支与远程保持同步
git fetch --all
7、最后拉取所有分支代码
git pull --all