How to Push Project (Repo) History to Git (Gitlab Server) After Server is Broken


I’m not familiar with GitLab, but with GitHub it should be as simple as committing the changes and force pushing to the remote repository (make sure you make a copy of the uncommitted directory in case of any unexpected failures):

$ git push <remotename> <branchname> --force

ex.

$ git push origin main --force

Without force pushing, git will ask you to rebase to the remote version, which is what you don’t want.

If this does not work, worst case scenario you can still create a new GitLab server and push files there, which is probably not a desirable solution.



Source link

Leave a Comment