I had a local GitLab server with a project. After few months, the server was broken and the repository was gone. Now, I have a local repository with unpushed files. All the history is available on my local repository though. The new GitLab server is now empty with no project.
How can I push all my local machine repository history (following with the unpushed files) to the new GitLab server? What steps should I do to create the repository just like the way it was before? There are other developers that we were working on this repo, however, they don't have any unpushed files. My local machine has the most updated state of the project.
This is what I did and it worked:
Create a new project on GitLab (with the same group and name as before)
Set the new GitLab Name and Email (if different from before):
$ git config --global user.name "Name"
$ git config --global user.email email@example.com
Commit any uncommitted changes on Git (git commit
).
Set the new GitLab project URL to Git (if changed from before):
$ git remote set-url origin [URL]
$ git push -u origin --all
$ git push -u origin --tags