# Cloning git repositories

**Once you have access to a valid license, you can simply install packages via `composer`, which is the most useful if you want to see things working within Magento. However, if you want to review the code only and/or if you want to contribute to the code, cloning git repositories is the way to go. This page describes the procedure and a couple of caveats to get started.**

## Getting Gitlab code access
By default, a new user is created on our Gitlab server with the role **Guest**. If you want to get access to files, we will manually need to upgrade your account to the role **Reporter**. Contact us if you want this.

Note that for one company multiple Gitlab accounts can be created. As a **Guest**, this allows you to review and create issues. We try to keep the number of accounts that have more advanced roles limited though.

## SSH port number
The SSH server of our Gitlab instance runs on port 61023 instead of the regular port 22. This is for security reasons.

To easily clone things, either use HTTPS or configure the SSH host in your own `.ssh/config` file first:
```config
Host gitlab.yireo.com
    Hostname gitlab.yireo.com
    Port 61023
    User git
```

## Cloning repositories via SSH
To clone a repository via SSH, use a command similar to the following:
```bash
git clone git@gitlab.yireo.com:loki-checkout/LokiCheckout_AccountType.git
```

## Cloning repositories via HTTPS
To clone a repository via SSH, use a command similar to the following (and make sure to replace `TOKEN` with your own personal access token which usually starts with `glpat-`):
```bash
git clone https://oauth2:glpat-TOKEN@gitlab.yireo.com/loki-checkout/LokiCheckout_AccountType.git
```

## Making changes
You are only allowed to make direct changes if you have the Gitlab role **Developer** (read: the core team only). Usually, if you want to make changes, you would fork the repository under your own Gitlab account and send your changes back to the original repository as a **Merge Request**.

The procedure in short:

- Fork the relevant repository;
- Create a new git branch `issue/something`;
- Checkout your own repository and this issue branch locally;
- Commit and push your changes to your own repository;
- In Gitlab, create a **Merge Request** for your changes;
