Import GitHub Repo to GitLab

Clone repo from Github to local machine

  • Go to the repository on Github and copy the clone with HTTPS address
  • On your local machine
git clone https://github.com/pnnl-sbrsfa/HFR-flow.git
  • now the remote origin is pointing to Github

Create new repo on Gitlab

  • Go to Gitlab-sbrsfa group, click New project and give a project name (let’s say test), then click Create project.
  • After the new project test has been created, you will see an option at the bottom of the page saying Push an existing Git repository.
cd existing_repo
git remote rename origin old-origin
git remote add origin https://gitlab.pnnl.gov/sbrsfa/test.git
git push -u origin --all
git push -u origin --tags # optional?
  • Follow the command line instructions and you are all set.
  • Now the remote origin is pointing to Gitlab
  • To see all the remotes available
git remote -v

Options to push changes

You can push your commit to different origins.

git push origin master # push to Gitlab
git push old-origin master # push to Github



    Enjoy Reading This Article?

    Here are some more articles you might like to read next:

  • A Quick Intro to Git
  • A simple word cloud from Google Scholar
  • A Quick Intro to Note-taking using Markdown
  • A Zotero to Obsidian Workflow
  • Create Your Academic Website using GitHub Pages