Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Migrate gitlab to gogs

Tags:

git

gitlab

gogs

Recently, i found a Gitlab alternative called Gogs.

Any suggestion for migrating repo in Gitlab to Gogs? I m not expecting all of it of course, just as much as possible.

like image 399
Wonson Avatar asked Jun 30 '15 02:06

Wonson


2 Answers

The correct steps for mirroring a repo is:

$ git clone --mirror [email protected]/upstream-repository.git
$ cd upstream-repository.git
$ git push --mirror [email protected]/new-location.git

Note: Do not use git push --mirror if you did not clone the repo with git clone --mirror. Also, git clone --mirror is preferred over git clone --bare as it will clone all git notes and attributes as well.

Reference: http://blog.plataformatec.com.br/2013/05/how-to-properly-mirror-a-git-repository/

like image 56
pobzeb Avatar answered Oct 08 '22 04:10

pobzeb


Clone localy the bare git repo (=server side repo) and push it as a mirror to new repo:

git clone --bare http://my.gitlab.project.git
cd project.git
git push --mirror http://my.gogs.project.git

This will push all your commits, branches, tags etc. This will work for any git repo, whatever it's hosted on gitlab, gog, github, etc.

like image 30
PierreF Avatar answered Oct 08 '22 03:10

PierreF