# Cloning a Git repository on your server

{% hint style="warning" %}
If you are having trouble cloning from a Git repository you can always download the files to your PC then upload them to the server.
{% endhint %}

To clone a Git repository on to your server you must configure the repository in the startup tab.

The first thing you must set is the repository address:

<figure><img src="https://806961661-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMFuI5KJS4gyto7zpZWS0%2Fuploads%2F9CB5vblX0st7dCI92iIJ%2Fimage.png?alt=media&#x26;token=51fb1798-ef09-4812-b82b-7be47e37b207" alt=""><figcaption></figcaption></figure>

This is the URL that your repository is at, e.g. <https://github.com/yourname/reponame>.

Next you must set the install branch, for most people this is probably `master`. This is the production branch of your repository that should be pulled.

<figure><img src="https://806961661-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMFuI5KJS4gyto7zpZWS0%2Fuploads%2FOlr9tcIAiWLDWoMPNGnc%2Fimage.png?alt=media&#x26;token=3d12dc60-3a18-49aa-8225-f1ea75ff0bd3" alt=""><figcaption></figcaption></figure>

#### If you repository is a private repository you must fill in the following variables

You must enter your username on the Git host in the Git username variable:

<figure><img src="https://806961661-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMFuI5KJS4gyto7zpZWS0%2Fuploads%2FpPn7wUoqBYBcCkcmBC6l%2Fimage.png?alt=media&#x26;token=fe0a3b57-fee2-429f-a35d-54b9a56a0f91" alt=""><figcaption></figcaption></figure>

And then you must enter your personal access token. Depending on the site you use to host your repository this can be found at the following links:

* [GitHub](https://github.com/settings/tokens)
* [GitLab](https://gitlab.com/-/profile/personal_access_tokens)

If you use a different service to host your repository you must create a personal access token with them.

#### Finally...

You must trigger the cloning so your server can pull from the repository every time it restarts. To do this firstly make sure there are no files on your server then on the settings page of your server click `Reinstall Server`.

<figure><img src="https://806961661-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMFuI5KJS4gyto7zpZWS0%2Fuploads%2FSQQwIDICAFLldHSddLce%2Fimage.png?alt=media&#x26;token=6a5ae08f-49ec-485c-bcc1-ad79ff2f7126" alt=""><figcaption></figcaption></figure>

Your repository should then clone!
