gitlib代碼遷移

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 查看內容

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章