Git clone 所有分支、tag到本地,然后push到一个新的远程仓库

tech2025-10-21  4

Git clone 所有分支、tag到本地,然后push到一个新的远程仓库

clone 所有分支到本地

git clone xxxx.git git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done git fetch --all git pull --all

push 到新的远程空仓库

git remote rename origin old-origin git remote add origin https://yyyy.git git push -u origin --all git push -u origin --tags
最新回复(0)