Import Github Repo To Gitlab@pnnl
Published:
Import Github repo to Gitlab@PNNL
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 saytest
), then clickCreate project
. - After the new project
test
has been created, you will see an option at the bottom of the page sayingPush 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