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

2020-07-24  本文已影响0人  栗子daisy

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】

原文:https://www.cnblogs.com/mzdljgz/p/11699302.html

1

0

» 下一篇: 集成测试之自顶向下、自底向上、三明治集成

posted @ 2019-10-24 09:00 掌上编程 阅读(282) 评论(0) 编辑 [收藏](javascript:void(0))

[](javascript:void(0);)

上一篇 下一篇

猜你喜欢

热点阅读