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

# Connect GitHub

> Bind a project to a GitHub repository and inspect source state.

Run `goalmatic git connect` from a linked project. The CLI opens the Goalmatic GitHub setup page. Authorize the Goalmatic GitHub App, choose a repository, and return to the CLI.

Run `goalmatic git status` to inspect the repository, branches, source authority, and current revision.

For a new project, the CLI connects the generated folder to the chosen repository.
It fetches the exact preview commit and preserves existing files. It does not
commit, push, force-reset, or switch an existing checkout to a different branch.
If local files differ, review and commit them using your normal Git workflow.

Private repositories also require Git credentials on your machine. Your browser's
Goalmatic connection does not configure Git's local credential helper. If fetching
the repository fails for authentication, use GitHub CLI or Git Credential Manager
to sign Git in, then repeat `goalmatic git connect` for the same repository.

A GitHub connection makes Git the source authority. A push changes source. It does not publish a Site or release an App. For an App, push the configured preview branch to `origin` and keep the local checkout on the clean imported preview branch while you review the test runtime. Then use `goalmatic publish --from-preview` to promote the exact tested tree to the configured `main` or `master` branch without merging or creating a new build. Follow [deployment and release](/deploy-and-release).

Keep secrets out of Git. The server scans source before it accepts an authority migration or source update.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.