There is a lot of ways how to use git and sometimes a working solution can be very helpful for everybody. So please share you experience and working solutions.
[[_TOC_]]
## HowTo Sync a GitHub and a GitLab repository
It is easy to import a GitHub repo into GitLab and the otherway around. However, if you want to make sure you can have both repos at the same state, you need to syncronize them.
How to call: `./git-repos-sync [URL1] [URL2] [Branch]`
This means:
-`URL1` - Address of the first remote repository
-`URL2` - Address of the second remote repository
- The order of `URL1` or `URL2` does not matter.
-`Branch` is usually `master`
Different use cases:
1. You have **already** a local copy of either of the repositories (e.g. GitLab or GitHub)
2. You have no local copy of either repository.
### Case 1
```bash
cd dir-of-repo
# copy the script there
wget
# execute the script
./git-repos-sync [URL] [URL] [Branch]
```
### Case 2
```bash
# Create a new folder to do the sync, can be any name