Theory:
your git repository can have more than one remote server; In this case we want to have two:
- one for our private repository on gitlab (will be the default one, called
origin
) - one to be connected to the source repo on github, to be able to pull new changes (will be called
upstream
)
How to make a private fork from github to gitlab
# 1. clone the github project in your workspace
git clone [email protected]:whatever/repo.git
# 2. rename the remote
git remote rename origin upstream
# 3. Create a new repo in gitlab website
# 4. Add the new origin to your repo
git remote add origin [email protected]:whatever/swiper.git
# 5. push to the private repository (track master)
git push -u origin master
To push to gitlab / master, just use
git push
To retrieve updates from github, use
git pull upstream master