Skip to content

Latest commit

 

History

History
30 lines (26 loc) · 982 Bytes

Sync.md

File metadata and controls

30 lines (26 loc) · 982 Bytes

How to synchronize both GitHub and Kent GitLab repositories

Don't forget to set your ssh key in the Gitlab settings !

Create a new remote called "all" with the URL of the primary repo.

git remote add all git@github.com:nathan-hoche/CarRacing.git

This will add a new remote called "all" with the URL of the primary repo.

Re-register the remote as a push URL.

git remote set-url --add --push all git@github.com:nathan-hoche/CarRacing.git

When pushing to the "all" remote, you will push to both the origin and the secondary repo.

Add the secondary repo as a push URL.

git remote set-url --add --push all git@git.cs.kent.ac.uk:gh384/aisystemimplementation-project.git

Push to both remotes.

git push all main

This will push to both the origin and the secondary repo.

Pull from both remotes.

You cannot pull from two remotes so you only pull from the primary repo.

git pull origin main