码迷,mamicode.com
首页 > 其他好文 > 详细

git仓库迁移和更新远程仓库地址

时间:2016-08-31 20:40:10      阅读:215      评论:0      收藏:0      [点我收藏+]

标签:

一、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

 

git仓库迁移和更新远程仓库地址

标签:

原文地址:http://www.cnblogs.com/softidea/p/5827361.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!