首页 > 技术文章 > gitlab迁移远程仓库技巧

kdx-2 2019-08-14 13:55 原文

1.到工程目录下(例如 cd test-web/)

2.查看当前远程仓库分支

git remote -v

(例如得到:git@10.10.10.10:web/test-web.git)

3.移除当前地址

git remote remove origin

4.添加新地址

git remote add origin <新的远程仓库地址>

(例如:git remote add origin git@10.10.10.10:web/test-web.git )

5.同步远程仓库

git pull

6.设置当前分支(本地分支对应的远程分支)

git branch --set-upstream-to=origin/<branch><本地当前分支>

例如:git branch --set-upstream-to=origin/dev_20190101 dev_20190101

推荐阅读