gitlib代碼遷移
目標:gitlib代碼遷移,保存commit,branch
一、下載所有代碼信息
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
二、添加新的倉庫地址
vi .git/config
#添加新的推送地址
[remote "newGitRep"]
url = [email protected]:newGitRep/newGitRep.git
fetch = +refs/heads/*:refs/remotes/origin/*
三、推送內容
git push newGitRep
四、登陸git 查看內容