Tip

Migrate repository to different provider with history

There are certain times you need to change move your repository to different service provider with history.

Assume that you have a repository in GitLab and you wanted to migrate it to GitHub. Here is the basic steps to follow.

Clone your repo

Clone repository to your local machine including all branches and tags.

git clone --mirror https://gitlab.com/username/your-repo.git

Note: --mirror option ensures that all branches, tags and history are cloned.

Create a new repo on GitHub

  1. Login to Github
  2. Create a new repo.
  3. Do not initialize readme, .gitignore or license to prevent conflicts.

Push to Github

Update the remote repo url to point to new GitHub repo.

git remote set-url origin https://github.com/username/your-new-repo.git

Then push your repo to the new target.

Posts created 3

Related Posts

Begin typing your search term above and press enter to search. Press ESC to cancel.

Back To Top