I have recently installed GitLab with Docker in a server within a local network. I am trying to migrate a repository I mantained locally in my PC. I exposed it through a local HTTP server within my local network as a workaround, just to be able to import it to GitLab, because almost all options available in GitLab admin Panel are like "Import from GitHub", and none of those options will help in my case (I mean: couldn't I just upload my repository's .git
folder to import it? -retorically speaking) By the way, the one I chose was "Repo by URL":
There's a security setting that I had to disable, because GitLab doesn't allow importing from URLs that point towards a server in your local network. So I turned on the option called "Allow requests to the local network from hooks and services" within the Outbound Services section.
Then, I tried making a new project from GitLab, using the tab called "import project" and filling the form within it. Then, it keeps running for a long while with the message "Importing..." looks like it keeps retrying over and over, until this message is shown:
Every import attempt has failed: Error importing repository http://111.222.33.44/path/to/my/repository/root/folder/.git into myuser/my_project - 13:CreateRepositoryFromURL: clone cmd wait: exit status 128. Please try again.
I have been reading the Gitlab Manual posted online, different articles about GitLab, googled about this error and found tens of tickets with similar (but very different!) issues... But I still don't understand: why can't I just upload my repository right away?
The URL given is not the problem per se: if I type it into a web browser, I can see clearly the entire filesystem of my project within the web browser, and, if I add /.git
to it, I can even see the hidden .git
folder's content in my browser... but, for some reason, this isn't enough for GitLab...
I am very confused about this. One of the links I found is Export a repository from a Gitlab server to another Gitlab server (Please notice I am mot importing from other Gitlab, but a simple git repository created in a PC with a simple git init
. Finding reading material about something remotely similar to my case isn't a piece of cake: I have been searching about this the whole day, without success...). Within that link, there is a part that says:
You will get warnings that you cloned an empty repository. This is normal. Change into the working directory of your checked out repository and do a git pull
...so I found the folder where my GitLab installation created the "empty repository", and tried executing the git pull
command from there, giving it the route to my other local server machine. Something similar to this:
git pull http://111.222.33.44/path/to/my/repository/root/folder/my_project.bundle
...just after succeeding making a .bundle
file on the other side, following the instructions I found in the above link. But, for some reason, my GitLab server's CLI doesn't find the command git
! (Perhaps is is wrapped on some kind of virtualenv
? Or rather it wasn't included in PATH
in the first place? Who knows...). In any case, pull to where? There's no working directory to pull from!
Is there something else I could do about this? My knowledge about Git is limited: I have almost always used it to mantain repositories on my own, all alone, without the need to push
them anywhere, neither pull
them from anywhere (with the rare exception of one GitHub project of mine).
I might add that the official Gitlab's manual about howto import projects includes instructions to migrate from everywhere, except the original, unwrapped, unsugared, normal git
command-line software!