# GitHub Cloud

{% hint style="info" %}
For more information on what data Haystack uses from Git, [here is an article!](https://help.usehaystack.io/admin/security-and-privacy)
{% endhint %}

## Configure

{% tabs %}
{% tab title="Update integration" %}
{% hint style="info" %}
Default token would give a sync time of 30 minutes.

To improve the sync time to 10 seconds check [Real Time Data Sync](https://help.usehaystack.io/setup/integrations/broken-reference) doc.
{% endhint %}

1. Go to [Org settings -> Integrations -> Version Control](https://delivery.usehaystack.io/integrations/version-control).
2. Select `Connect GitHub -> GitHub Cloud`.
3. You will be redirected to GitHub connect page. Select which GitHub account to integrate to Haystack:

   <figure><img src="https://933147321-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbiIqB8vq91hNrILQ1MAF%2Fuploads%2F8WglzRBaQgBRSlOqN0h5%2Fimage.png?alt=media&#x26;token=ced2a3ae-6b71-4ecf-a6c6-8c8257e8794f" alt=""><figcaption></figcaption></figure>
4. Select repositories. If you select specific repositories, you will have to give access to all newly created repositories later on:

<figure><img src="https://downloads.intercomcdn.com/i/o/254980857/b39ee9adafdcf09bc61f18b5/select-repos.gif" alt="" width="563"><figcaption></figcaption></figure>

5. **Redirection:**
   1. **You have permission to give access GitHub. I**f you see the above page, press "Continue" and move to Step &#x38;**:**

      <figure><img src="https://933147321-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbiIqB8vq91hNrILQ1MAF%2Fuploads%2FTbLjHHN5naQ8gQ000Dwq%2Fimage.png?alt=media&#x26;token=c606a81c-2bd8-4e2c-b843-28b174ea7fe7" alt=""><figcaption></figcaption></figure>
   2. **Need approval from GitHub Admin.** If you don't have admin permissions in GitHub, you will need to receive approval from your GitHub admin and enter a token to link Github with Haystack:

      <figure><img src="https://933147321-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbiIqB8vq91hNrILQ1MAF%2Fuploads%2FU2jd4DQOgtqIV25mOznu%2Fimage.png?alt=media&#x26;token=b04bb5e6-f183-4624-9172-1d6392f912dc" alt=""><figcaption></figcaption></figure>

      The GitHub admin will receive an email from GitHub to grant access to the organization. After they do it, they will be redirected to the Haystack page with the token:

      <figure><img src="https://933147321-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbiIqB8vq91hNrILQ1MAF%2Fuploads%2FQxxWE6sLk7NRUchxHtFl%2Fimage.png?alt=media&#x26;token=31d23c34-c5c9-4352-b14d-73ab03c08a89" alt=""><figcaption></figcaption></figure>

      **Important**: Inform the GitHub admin in advance not to close the page before copying the token. If they close the page, they will need to uninstall the Haystack app from Github and you will need to start Github integration from scratch.
6. Wait for the data to sync. This usually takes about 4 hours, but due to GitHub API limitations can extend up to 24 hours depending on the organization size.
   {% endtab %}
   {% endtabs %}
