> 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/guides/clone-a-github-repository.md).

# Clone a GitHub Repository

{% 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 %}

There are two ways to clone your GitHub repository:

* **On server creation:** Select **GitHub** as the source, as explained in [Set Up a Server](/bot-hosting.net/guides/set-up-a-server.md).
* **Files tab:** Click the GitHub icon in the options bar, then follow the steps.

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

Choose the repository type:

* **Private:** Requires a GitHub account connection. Select the repository and branch if the account is already linked.
* **Public:** Requires a GitHub repository link.

{% hint style="info" %}
Private repositories require access to the target repository. If it does not appear in the list, reconnect GitHub and confirm the account can read that repository.
{% endhint %}

Choose the sync strategy:

* **Replace all files:** Removes everything already present on the server. Use this for a clean deployment.
* **Merge:** Keeps existing files and overwrites files with the same name and location from the repository. Use this to update an existing setup.
* **Add in subfolder:** Clones files into a subfolder. Use this when the repository is only part of your server files.

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

Finally, click **Sync** and wait for the server to finish cloning.

### Troubleshooting

* **Repository does not appear:** Reconnect GitHub, then check that the account has access to the repository.
* **Wrong files were imported:** Confirm the selected branch and sync strategy, then run the sync again.
* **Clone fails:** Verify the repository link, make sure the repository still exists, and confirm GitHub is reachable.


---

# 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/guides/clone-a-github-repository.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.
