---
title: "gitlab 项目迁移"
author: "scm002"
date: "2017-03-04T11:45:52Z"
tags: []
categories: ["编程语言"]
slug: "gitlab"
draft: false
lastmod: "2017-03-04T11:45:52Z"
id: 2360244
url: "https://scm002.iteye.com/blog/2360244"
---

gitlab项目迁移:

 

一: 场景

    目前有2个gitlab server,需要将gitlab-A server项目迁移到另外一个gitlab-B server.

二: 步骤

    1. 在gitLab-B上新建组和项目，组和项目名称和gitlab-A的组合项目名称一一对应。

    2. 将gitlab-A项目clone到本地

       git clone https://github.com/group/hello.git

    3. 进入项目hello, 执行一下命令

       cd hello

       git remote set-url origin ssh://git@172.16.2.94:10022/group/hello.git

       git push -u origin master

       git checkout develop

       git push -u origin develop

       git checkout testing

       git push -u origin testingg