> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sphinx.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect GitHub and add a repository

> A step-by-step guide to connecting GitHub and adding repository knowledge to Sphinx.

Connect your GitHub account, choose a repository, and tell Sphinx what to learn from it. A **repository** is a collection of files stored in GitHub. An **ingest** is the process of reading those files and turning them into knowledge in Sphinx.

## Before you start

Have these ready:

* Your Sphinx sign-in and the workspace you want to use.
* Your GitHub sign-in and the name of the repository you want to add.
* Someone who manages your company's GitHub account, in case GitHub asks for their approval.

<Note>
  Git ingest is currently in **beta**. If you cannot find **Git Repository** in Sphinx, ask the Sphinx team to enable it for your workspace.
</Note>

The screenshots use development workspaces and `sphinx-ml/docs` as an example repository. Your workspace and connector names may look different.

## 1. Connect GitHub

A **connector** is the saved connection between Sphinx and GitHub. You will create one, allow access in GitHub, and then sign in to it.

<Steps>
  <Step title="Open Connectors">
    In Sphinx, click **Settings** at the bottom left.

    Check that the correct **Workspace** is selected, then click **Connectors**.

    <Frame caption="Settings → Connectors">
      <img src="https://mintcdn.com/sphinx-977f1673/d5ifIIhFBi4rkDeI/git-ingest/01-open-connectors.png?fit=max&auto=format&n=d5ifIIhFBi4rkDeI&q=85&s=11c1332903fc96caf6457bd0d1e3e829" alt="Sphinx Settings drawer with a workspace selected and the Connectors link visible" width="1280" height="720" data-path="git-ingest/01-open-connectors.png" />
    </Frame>
  </Step>

  <Step title="Choose GitHub">
    Click **New connector**.

    Under **Documents & repositories**, click **GitHub**.

    <Frame caption="Choose the GitHub card.">
      <img src="https://mintcdn.com/sphinx-977f1673/d5ifIIhFBi4rkDeI/git-ingest/02-choose-github.png?fit=max&auto=format&n=d5ifIIhFBi4rkDeI&q=85&s=d9c84df4421b2b2e7d30ab3e58b4633b" alt="GitHub card under Documents and repositories on the Available connectors page" width="1280" height="720" data-path="git-ingest/02-choose-github.png" />
    </Frame>
  </Step>

  <Step title="Name your connection">
    In **Connector name**, enter a name you will recognize, such as `GitHub documentation demo`.

    Click **Connect GitHub**. GitHub opens in another tab. Keep the Sphinx tab open.

    <Frame caption="Enter a name, then click Connect GitHub.">
      <img src="https://mintcdn.com/sphinx-977f1673/d5ifIIhFBi4rkDeI/git-ingest/03-name-connector.png?fit=max&auto=format&n=d5ifIIhFBi4rkDeI&q=85&s=17ab6af5828329f4c8c70e5cc9e06a28" alt="GitHub connector form with an example name and the Connect GitHub button" width="1280" height="720" data-path="git-ingest/03-name-connector.png" />
    </Frame>
  </Step>

  <Step title="Choose the repository in GitHub">
    Sign in to GitHub if asked. Choose the account or company that owns your repository.

    Select **Only select repositories**, open **Select repositories**, and choose the repository you want Sphinx to read. Our example is `sphinx-ml/docs`.

    Review the permissions, then click **Install**. If the app is already installed, you may see **Update access** instead.

    <Frame caption="Choose your repository. This example shows an app that is already installed.">
      <img src="https://mintcdn.com/sphinx-977f1673/d5ifIIhFBi4rkDeI/git-ingest/05-github-repository-access.png?fit=max&auto=format&n=d5ifIIhFBi4rkDeI&q=85&s=7b8151fb6d3366208325e32c19ab1d76" alt="GitHub repository access screen with sphinx-ml/docs selected and read access to code and metadata shown" width="934" height="866" data-path="git-ingest/05-github-repository-access.png" />
    </Frame>

    <Note>
      If GitHub shows **Request** or says an organization owner must complete this action, ask the person who manages your company's GitHub account to finish this step. See [GitHub's installation help](https://docs.github.com/en/apps/using-github-apps/installing-a-github-app-from-a-third-party) for details.
    </Note>
  </Step>

  <Step title="Return to Sphinx and sign in with GitHub">
    Return to your Sphinx connector tab. Refresh the page if needed.

    Under **Authentication**, click **Sign in with GitHub**. Follow GitHub's prompts to authorize the connection.

    When you see **Authentication successful. You can close this tab.**, close that tab and return to Sphinx.

    <Tip>
      If **Sign in with GitHub** is greyed out, finish **Install GitHub App** first. Installation and sign-in are two separate steps.
    </Tip>
  </Step>

  <Step title="Check that you are connected">
    Your connector should now show **Manage GitHub App** and **Reconnect GitHub**. Refresh the page if those buttons have not updated.

    You are ready to set up the ingest.

    <Frame caption="These buttons show that installation and sign-in are complete.">
      <div role="img" aria-label="Connected GitHub authentication panel showing Manage GitHub App and Reconnect GitHub" style={{ width: "100%", aspectRatio: "678 / 176", backgroundImage: "url('https://mintcdn.com/sphinx-977f1673/d5ifIIhFBi4rkDeI/git-ingest/08-connected-github.png?fit=max&auto=format&n=d5ifIIhFBi4rkDeI&q=85&s=8114a877d3388443fec9951f07c93fb0')", backgroundSize: "137.758112% auto", backgroundPosition: "95.3125% 18.26087%", backgroundRepeat: "no-repeat" }} />
    </Frame>
  </Step>
</Steps>

## 2. Set up the ingest

<Steps>
  <Step title="Start a new ingest">
    In the same Sphinx workspace, click **Ingest** in the left sidebar.

    Click **New Ingest** at the top right.

    <Frame caption="Ingest → New Ingest">
      <img src="https://mintcdn.com/sphinx-977f1673/d5ifIIhFBi4rkDeI/git-ingest/06-new-ingest.png?fit=max&auto=format&n=d5ifIIhFBi4rkDeI&q=85&s=ec252b7312e614d9aa76aa6bba66af25" alt="Ingest page with New Ingest at the top right" width="1280" height="720" data-path="git-ingest/06-new-ingest.png" />
    </Frame>
  </Step>

  <Step title="Choose Git Repository">
    Scroll down to **Experimental** and click **Git Repository**.

    <Frame caption="Find Git Repository near the bottom of the page.">
      <img src="https://mintcdn.com/sphinx-977f1673/d5ifIIhFBi4rkDeI/git-ingest/07-choose-git-ingest.png?fit=max&auto=format&n=d5ifIIhFBi4rkDeI&q=85&s=d041cf034b9bfa831a4b5d02d72e7f06" alt="Git Repository card in the Experimental section of the ingest options" width="1280" height="720" data-path="git-ingest/07-choose-git-ingest.png" />
    </Frame>
  </Step>

  <Step title="Choose your connection and repository">
    In **GitHub connector**, select your saved GitHub connection.

    In **Repository**, choose the repository you want to add. For this example, choose `sphinx-ml/docs`.

    Choose the connection you named earlier: `GitHub documentation demo` in this example.
  </Step>

  <Step title="Write a detailed focus prompt">
    In **Focus prompt**, explain what you want Sphinx to learn and give it the context it needs to understand your repository.

    <Tip>
      **Take time to write a detailed, specific prompt.** A high-quality focus prompt helps Sphinx find the right information and preserve the details your team needs. Include useful context and concrete questions, rather than just asking it to “summarize the repository.”
    </Tip>

    You do not need to write code. In plain language, include:

    * **Your goal:** Who will use this knowledge, and what should it help them do?
    * **Where to look:** Name important topics, folders, or files if you know them.
    * **Context:** Explain unfamiliar terms and identify which information is current or most reliable.
    * **Details to keep:** Call out rules, calculations, exceptions, dependencies, or setup steps that matter.
    * **Questions to answer:** Give a few real questions you want Sphinx to be able to answer afterward.

    For the documentation repository in this guide, a detailed prompt could look like this:

    ```text theme={null}
    Help customer-facing teammates explain how customers connect Claude
    and ChatGPT to Sphinx. The knowledge should support someone walking
    a non-technical customer through setup.

    Start with the guides in claude/, claude-code-cli/,
    claude-desktop/, and chatgpt-desktop/. Follow related guides when
    they explain a prerequisite or a step in the same setup process.

    Keep the instructions for each client separate. Explain the
    difference between connecting to Sphinx MCP and using the Sphinx
    LLM Gateway, based on the repository's guides.

    Preserve prerequisites, exact button names, configuration values,
    sign-in steps, actions that need an administrator, and how users
    check that the connection worked. Include documented troubleshooting.
    If guides disagree or leave a step unclear, call that out instead
    of guessing.

    The knowledge should answer:
    - What does a customer need before starting each setup?
    - What should they click and enter, in order?
    - Which steps need help from an administrator?
    - How do they confirm that setup worked?
    ```

    <Accordion title="Example for an internal analytics dashboard repository">
      Use this example if your team builds internal analytics dashboards. Add the dashboard names, business topics, and folders that matter to your team.

      ```text theme={null}
      This repository contains our internal analytics dashboards. Help
      our teammates understand what each dashboard shows, how its numbers
      are calculated, and how to use them to answer business questions.
      We want Sphinx's knowledge to reflect the repository as it evolves.

      Focus on dashboard definitions, charts, queries, data models, and
      related documentation. Follow supporting code, configuration, and
      tests when they explain a calculation or business rule.

      For each dashboard, explain its purpose, intended audience, and
      the business questions it answers. Preserve chart and metric names
      so teammates can match the explanation to what they see on screen.

      For each metric, explain its business meaning, calculation, source
      tables, filters, exclusions, and time period. Explain how tables
      connect, what one row represents, and how dates and time zones
      affect the result. Include these details when the repository
      provides them; flag anything unclear instead of guessing.

      Explain how dashboard filters, default selections, and drill-downs
      change the numbers. Include documented refresh schedules, data
      delays, limitations, and reasons similar charts may disagree.

      On each ingest, use the current repository definitions. Capture
      new dashboards and changed calculations, filters, or business
      rules. Identify deprecated dashboards and metrics where the
      repository marks them as such. Include relevant file paths so
      teammates can find the source of an explanation.

      The knowledge should answer:
      - Which dashboard should I use for my business question?
      - What does this metric mean, and how is it calculated?
      - What data is included or excluded?
      - How do filters and date ranges affect the result?
      - How fresh is the data, and what limitations should I know?
      ```
    </Accordion>

    Adapt these examples to your repository. **Specificity matters more than length:** include the context you know and the details you need, without adding unrelated instructions. Explain the business meaning you want to capture, rather than asking for a file-by-file code summary.

    <Frame caption="Choose a connector and repository, then enter your detailed focus prompt. You can scroll within the prompt to review it.">
      <img src="https://mintcdn.com/sphinx-977f1673/d5ifIIhFBi4rkDeI/git-ingest/10-configure-ingest.png?fit=max&auto=format&n=d5ifIIhFBi4rkDeI&q=85&s=35480dac28d27dd903143959fdf47cc2" alt="Git Repository form with a saved connector, sphinx-ml/docs repository, a detailed focus prompt, and Create ingest button" width="1280" height="720" data-path="git-ingest/10-configure-ingest.png" />
    </Frame>
  </Step>

  <Step title="Create the ingest">
    Check that the repository and focus prompt are correct, then click **Create ingest** once.

    Sphinx opens a page where you can follow its progress. You can also find the job later under **Ingest**.

    When **Review Changes** appears, click it to read the proposed knowledge before accepting it.
  </Step>
</Steps>

## If you get stuck

<AccordionGroup>
  <Accordion title="GitHub did not open, or I closed the tab">
    Go to **Settings → Connectors** and open your connector.

    Click **Install GitHub App** to finish installation, or **Sign in with GitHub** to finish signing in. You do not need to create another connector.
  </Accordion>

  <Accordion title="GitHub says I need an organization owner">
    Ask the person who manages your company's GitHub account to complete the app setup for your repository. Return to Sphinx afterward and refresh the connector page.

    If the app already has access but Sphinx still shows **Install GitHub App**, ask the Sphinx team for help connecting that existing installation.
  </Accordion>

  <Accordion title="My repository is missing">
    Check that you selected the right GitHub connector and signed in with an account that can access the repository.

    Open the connector and use **Manage GitHub App** to check that your repository is included. Ask your GitHub administrator for help if you cannot change this. Then reload the ingest page and select the connector again.
  </Accordion>

  <Accordion title="My connector is missing">
    Check the **Workspace** in Settings. Use the same workspace where you created the connector.
  </Accordion>

  <Accordion title="Git Repository is missing">
    Ask the Sphinx team to enable Git ingest for your workspace. Include your workspace's name.
  </Accordion>

  <Accordion title="Create ingest is greyed out">
    Make sure you selected a connected **GitHub connector**, chose a **Repository**, and entered a **Focus prompt**.
  </Accordion>

  <Accordion title="Which version of my files will Sphinx read?">
    Sphinx reads the repository's default branch—the version GitHub normally shows when you open the repository. There is no branch selector on the ingest page.
  </Accordion>

  <Accordion title="I need help with an ingest">
    Share the job ID, repository name, and any error message with the Sphinx team. If knowledge is missing, give one example of what you expected Sphinx to learn.
  </Accordion>
</AccordionGroup>
