Reputation: 495
I am wondering if it is possible to restore a remote git repo from a local .git folder. And if so, how.
Some back story to what happened and what I am trying to do. Recently one of my servers had a hardware failure and sadly it was what hosted my git server (via gitlab). After 24 hours of tech support tickets and junk, the host lost my hard drive and said basically 'oh well'.
So I am now rebuilding my server after what happened and I am trying to see if I can restore the git repos from my local .git folder. I do not want to lost the commit history and such from the repo. My local .git folders have all the history and such still in tact and can be accessed without any info on the remote repo still being around.
So is there a way to restore the repo's on the server using my local .git folder copies so I can retain the commit history and other information? I would rather not start over entirely and just check in the current code as-is. The commit log preserved contributor information and such which I don't want to cheat anyone out of their work.
Upvotes: 1
Views: 113
Reputation: 1420
Just use git push
to push your local repository to your sever is OK.
Upvotes: 1
Reputation: 1329972
That is possible: you can initiate a new GitLab server with import of existing repos.
See "Import bare repositories into your GitLab instance"
You can export your local git repo with git bundle
(that compresses the repo in one file: easier to copy around).
Upvotes: 2