C3 AI Documentation Home

Version Control and GitHub Integration

Every C3 Code workspace is backed by a Git repository. The AI agent automatically commits and tags the repository after each generation run, giving you a complete history of every iteration. You can connect that repository to a remote GitHub account to push and pull changes. This lets you branch across workspaces and integrate C3 Code with your existing development workflow.

How C3 Code uses Git

C3 Code creates a local Git repository for each application when the application is created. Git setup is automatic.

After every AI generation run — each time you send a prompt and the AI modifies your application — C3 Code automatically:

  1. Commits all changed files with a generated commit message describing the change.
  2. Creates a Git tag on that commit, which is used by the rewind feature to restore the application to any prior state.

This captures your entire iteration history in Git, even if you never manually commit.

When you need a remote repository

Connecting a remote repository is optional for solo work but required for:

  • Pushing your code to GitHub for backup, review, or CI/CD (continuous integration and delivery).
  • Collaborating with other developers via pull requests and code review.
  • Creating a C3 Code application from an existing codebase.
  • Accessing your workspace's code from the C3 VS Code Extension.

Connecting GitHub

GitHub connects via OAuth (Open Authorization). You connect your GitHub account once from the User Settings page, and the connection applies to all your workspaces.

To connect GitHub:

  1. Select User Settings from the C3 Code navigation.
  2. Under Git Providers, select Connect with GitHub.
  3. Authorize C3 Code on GitHub's OAuth page.
  4. After authorization, GitHub redirects you back to C3 Code. The status indicator shows Connected.

When you connect GitHub, C3 Code automatically adds the GitHub MCP (Model Context Protocol) server to your AI assistant. This gives the assistant access to your GitHub repositories, issues, and pull requests as context when you prompt it.

Connecting a repository to your application

Once your GitHub account is connected, you can link a repository to your application. The link is at the application level — all workspaces in the application share the same remote repository but each workspace operates on its own branch.

You can connect a repository from the Git status control in the workspace header.

To create a new repository and connect it:

  1. Select the Git status control in the workspace header.
  2. In the popover, select Create Repository.
  3. Enter a repository name. The name defaults to the application name.
  4. Select Create repository. C3 Code creates the repository in your GitHub account and pushes the current workspace code to it.

To connect an existing repository:

  1. Select the Git status control in the workspace header.
  2. In the popover, select Select Existing Repository.
  3. Select a repository from the list of repositories in your GitHub account.
  4. Select Connect. C3 Code links the repository to the application.

Creating a C3 Code application from a GitHub repository

You can start a new C3 Code application directly from an existing GitHub repository. C3 Code clones the repository into a new workspace so you can continue developing the application using the AI assistant.

To create an application from a GitHub repo:

  1. On the Applications page, select Create application.
  2. In the Create application modal, enter a name and then select Connect GitHub repository.
  3. Select the repository from your GitHub account.
  4. Select Create. C3 Code clones the repository into the new application's first workspace.

The Git status control

The Git status control in the workspace header is the primary interface for all Git operations. It shows the current branch name and a colored status indicator. Select it to open the Git popover.

When no repository is connected, the popover shows your connection state and the actions needed to connect:

  • If you have no GitHub account connected: a prompt to go to User Settings and connect.
  • If you have a GitHub account connected but no repository linked: options to create or connect a repository.
  • If the application has a linked repository but you have not connected your personal GitHub account: a prompt to add your token in User Settings.

When a repository is connected, the popover shows the full Git interface.

Repository section

Shows the connected remote repository name and a link to open it on GitHub.

Pull and Push

  • Pull: Pulls the latest changes from the remote for the current branch. Uses rebase by default.
  • Push: Pushes local commits on the current branch to the remote without force.

Changes section

Lists all files with uncommitted changes, with a status indicator for each:

  • M: Modified (yellow).
  • A: Added (green).
  • D: Deleted (red).
  • R: Renamed (blue).
  • U: Untracked (gray).
  • C: Conflict (red).

Commit inputs

  • Summary: A short commit message (required).
  • Description: An optional extended description.
  • Commit to [branch]: Commits all changes with the provided message.

Branches section

  • Branch list: All branches in the repository, searchable by name. Branches are sorted: active branch first, then local-only branches, then remote branches. Select any branch to check it out in this workspace.
  • Create Branch: Appears below the branch list. Creates a new branch from the current branch and checks it out.

Conflict state

If the workspace has merge conflicts, the commit inputs are replaced with a conflict banner. Select Resolve Conflicts to send a request to the AI assistant to find, resolve, and stage the conflicting files.

Git LFS

C3 Code supports Git Large File Storage (LFS) transparently. If your repository contains LFS-tracked files, C3 Code pulls and commits them correctly without additional configuration. LFS files appear in the changes list like any other file.

See also

Was this page helpful?