gitgithubexportlocalgitlab

How to export an existing Git private project (earlier hosted on GitHub) from localbox to GitLab?


I have project in my localbox which was version controlled with Git and it was hosted on GitHub. If that project was a private one and I was one of the collaborators then(not any more a collaborator now as a result the import feature in GitLab to clone an existing GitHub repo won't work in my case and I'm not even sure if it is supposed to work for private GitHub projects for which one has only a collaborator access).

If I'd like to push all my commits with regard to that project (through what I have with me on my localbox) to a private repo on GitLab so that I can easily traceback my work done(in terms of my commits, pull requests, comments etc.). With regard to that project is there a way I can do so using Git and GitLab? If yes, please let me know the steps involved.


Solution

  • You can simply remove the remote origin that points to github and replace it with a new one

    git remote rm origin git remote add origin yourGitLabRepoURL/project git push origin master

    Source: http://git-scm.com/docs/git-remote