# 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="/files/UnVmbFjIlef77jvNm8Du" 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="/files/RfqcpwZSCgfWJsgyGriX" 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="/files/5uPUt54MLUKsWdCUyLAp" 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="/files/Nusfsvz0nOJ77tJCKzTR" alt=""><figcaption></figcaption></figure>

Your repository should then clone!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.bot-hosting.net/guides/cloning-a-git-repository-on-your-server.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
