@@ -6,16 +6,17 @@ On your already cloned github repo (working directory), add gitlab as a remote:
...
@@ -6,16 +6,17 @@ On your already cloned github repo (working directory), add gitlab as a remote:
git remote add gitlab git@gitlab.iath... (copied from earlier)
git remote add gitlab git@gitlab.iath... (copied from earlier)
```
```
Push every local branch to gitlab
Push every local branch to gitlab
'''
```
git push gitlab --all
git push gitlab --all
'''
```
You might have to change your upstream on a branch if you want to track gitlab instead of github:
You might have to change your upstream on a branch if you want to track gitlab instead of github:
'git branch --set-upstream-to=gitlab/master (or whatever other gitlab branch you want to track) This sets the current checked-out branch's upstream to whatever is passed.
'git branch --set-upstream-to=gitlab/master (or whatever other gitlab branch you want to track) This sets the current checked-out branch's upstream to whatever is passed.
Now, when you push/pull/fetch, you can choose what you want to do:
Now, when you push/pull/fetch, you can choose what you want to do:
```
'git push origin master pushes to remote origin, which is github
git push origin master pushes to remote origin, which is github
'git push gitlab master pushes to remote gitlab
git push gitlab master pushes to remote gitlab
'git fetch --all fetches both gitlab and github
git fetch --all fetches both gitlab and github
'git fetch gitlab would just fetch gitlab (similarly for origin)
git fetch gitlab would just fetch gitlab (similarly for origin)
'git remote remove origin would remove github as a remote.
git remote remove origin would remove github as a remote.