1、获取源仓库所有分支
git clone <源仓库>
cd <项目名称>
git branch -r | awk -F'origin/' '!/HEAD|master/{print $2 " " $1"origin/"$2}' | xargs -L 1 git branch -f --track
git fetch --all --prune --tags
git pull --all
2、同步到自己的仓库
git remote set-url origin <新仓库地址>
git pull
git push --all
git push --tags
注意:命令需要在linux环境执行,windows可以借助Cygwin64 Terminal 软件来实现