0

I have git server running over ssh. All git repos are under /opt/git/repos folder on my git server.

Now on the same server I installed gitlab. The url to the server remains the same. The folder where gitlab looks for repos is /opt/gitlab.

My question is, how do I move / import my existing repos under /opt/git/repos into /opt/gitlab so that gitlab can see them?

I am doing this on centos 6.x

5
  • I don't think there is a import-functionality, the cleanest way would be creating the repo's in the panel and pushing them to gitlab.
    – tkausl
    Commented Aug 22, 2016 at 12:24
  • You can add another origin - and push your local repo to it. Commented Aug 22, 2016 at 12:25
  • I am new to git. Some more technical hint will be very helpful. Thanks in advance..
    – BTR Naidu
    Commented Aug 22, 2016 at 12:27
  • I suspect the answer is (a) create the corresponding repository using the gitlab web UI, (b) configure ssh credentials if you're using ssh as your git transport, (c) git push your repositories to gitlab. Posted as a comment and not an answer because I don't have a gitlab instance to play with right now.
    – larsks
    Commented Aug 22, 2016 at 12:46
  • That helped. Giving you the detailed steps as answer.
    – BTR Naidu
    Commented Aug 22, 2016 at 13:40

1 Answer 1

1

Performed below steps:

  1. Crate a project for the git repo to be imported using gitlab gui.
  2. Executed below commands on the local system where I have the git repos cloned.

$ git remote add gitlab http://git.xxx.com/username/my-git-repo.git#

$ git push gitlab --mirror

Please note that I have copied the http address of the git repo from the gui after creating it.

Not the answer you're looking for? Browse other questions tagged or ask your own question.