Compilenix's Blog - Setup git to pull from upstream and push to another remote

RSS Feed | Find Stuff

Pull "master" from
Push "gitlab/master" to

Create an empty repo on the server for
Create the branch "gitlab/master" on the server for

git clone
cd tls-tester
git remote add lab
git config remote.pushdefault lab
git config push.default current
git fetch --all
git checkout gitlab/master
git branch --set-upstream-to=origin/master master

now when your current branch is "master" you can "git pull" and get the changes from
"git checkout gitlab/master" to switch to the fork
"git merge master" to merge the new changes into "gitlab/master"
do your thing to merge the new changes from upstream into your fork
"git push", while you are on the "gitlab/master" branch will push it automatically to