> For the complete documentation index, see [llms.txt](https://bothosting-net.gitbook.io/bot-hosting.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bothosting-net.gitbook.io/bot-hosting.net/legacy/git-clone.md).

# Clone a Git Repository on Your Server

{% hint style="success" %}
If your bot is a Java `.jar`, you do not need to clone a Git repository. Just upload the `.jar` file to your server.
{% endhint %}

To clone a Git repository onto your server, configure the repository in the Startup tab.

The first thing you must set is the repository address:

<figure><img src="/files/6PdySZrqzBMr8MD9dE1o" alt=""><figcaption></figcaption></figure>

This is the URL of your repository, for example `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/0dIE7VC8F48FAIkZqIii" alt=""><figcaption></figcaption></figure>

**If your repository is private, 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/FNzGxoLGIUYErRqiFpZ9" alt=""><figcaption></figcaption></figure>

Then you must enter your personal access token. Depending on the site you use to host your repository, you can find it 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 there.

**Finally...**

To make your server pull from the repository every time it restarts, you must trigger the initial clone. First, make sure there are no files on your server. Then, on the Settings page of your server, click `Reinstall Server`.

<figure><img src="/files/kBrFxeXG7R6w5qMVej4y" alt=""><figcaption></figcaption></figure>

Your repository should then be cloned.

### Possible Problem

| Issue                         | Reason                                                                                                                                                              |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| The repository doesn't clone. | Please make sure that you followed the guide step by step without missing anything. Do not enable/disable anything else unless you are sure of their functionality. |

If you are having trouble cloning a Git repository, you can always download the files to your PC and then upload them to the server. If you are uploading files directly from the control panel, see [Set Up a Server](/bot-hosting.net/legacy/setup-server.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://bothosting-net.gitbook.io/bot-hosting.net/legacy/git-clone.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
