git倉庫遷移和更新遠程倉庫地址


一、git倉庫遷移

1,從原倉庫clone或pull到本地倉庫

git clone project_name ​【old_remote_repository_address】

2,​在新的git創建一個新倉庫。如果用gitolite搭建的git服務器,那么只需要在配置文件gitolite.conf上添加倉庫和用戶,然后push到服務器即可。

3,進入clone下來的本地倉庫目錄,將遠程倉庫地址修改為新的遠程倉庫地址

project_name> git remote remove origin

 project_name> git remote add origin【new_remote_repository_address】

4,將本地倉庫文件push到新的遠程倉庫

project_name> ​gitpush origin master

二、修改​遠程倉庫地址

兩種方式,除了上面第3步的修改方法,還可以:

git remote set-url origin ​【new_remote_repository_address】

http://www.3566t.com/news/lygy/1498721.html

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM