C
Docs

Git Integration

View repository status, manage branches, create commits, and handle pull requests from your phone.

Overview

C3 provides comprehensive Git integration, letting you manage your repository directly from your mobile device. View changes, create commits, switch branches, and create pull requests — all without leaving the app.

Git features in C3:

  • View working tree status and file changes
  • Browse commit history with diff details
  • Create commits with file selection
  • Create and switch branches
  • Create pull requests (requires GitHub CLI)
  • Sync with remote (pull and push)
  • Track unpushed commits

GitHub CLI Required

The following features require the GitHub CLI (gh) to be installed and authenticated on your development machine:

  • Creating pull requests
  • Viewing existing pull requests
  • Fetching remote branches for PR base selection
  • Getting the repository's default branch

Install from cli.github.com, then authenticate:

gh auth login

Verify authentication:

gh auth status

Git Repository Required

Git features are only available for projects that are inside a Git repository. The Git icon only appears in the header when a repository is detected.

Accessing Git Features

Open the Git panel from the chat screen header:

  1. Navigate to any project's chat screen
  2. Tap the Git branch icon in the header (top right)
  3. The Git Changes modal opens with two tabs: Changes and History

Git Icon Badge

The Git icon shows a badge with the number of uncommitted changes. This gives you a quick view of your working tree status without opening the panel.

Header Toolbar

Once inside the Git panel, the header provides quick access to actions:

  • Commit icon — Open the commit modal (only shown when changes exist)
  • Branch icon — Open the branch selector
  • PR icon — Create or view pull request
  • Sync icon — Pull and push changes
  • Refresh icon — Refresh the current view

Changes Tab

The Changes tab shows your working tree status, split into two sections:

Staged Changes

Files that are ready to be committed. These appear at the top with a count indicator.

Unstaged Changes

Modified, added, or deleted files that haven't been staged yet.

File Status Indicators

StatusColorMeaning
MYellowModified
AGreenAdded
DRedDeleted
RPurpleRenamed
CCyanCopied
UGrayUntracked

Viewing Diffs

Tap any file to expand it and view the diff:

  • Green lines — Added content
  • Red lines — Removed content
  • Gray lines — Unchanged context

Tap again to collapse the diff. For untracked files, a "New file" message is shown instead of a diff.

History Tab

The History tab shows your commit history with two sections:

Unpushed Commits

Commits that exist locally but haven't been pushed to the remote yet. These are highlighted to help you track what needs to be synced.

Commit History

Your recent commits (up to 50) with:

  • Short hash — Abbreviated commit ID
  • Message — First line of commit message
  • Author — Who made the commit
  • Timestamp — Relative time (e.g., "5m ago")
  • Stats — Lines added (green) and removed (red)

Commit Details

Tap any commit to view its full details:

  • Complete commit message
  • Full commit hash
  • Author and date
  • List of changed files with diffs

Creating Commits

Create commits directly from C3 with full control over staging:

  1. Tap the commit icon in the Git panel header, or from within the Changes tab
  2. Enter a commit message (required)
  3. Select which files to include using checkboxes
  4. Optionally enable Sign-off to add a Signed-off-by line
  5. Tap Commit to create the commit

File Selection

The commit modal shows staged and unstaged files separately:

  • Pre-staged files are automatically selected
  • Use Stage Selected or Unstage Selected buttons to manage staging
  • Tap checkboxes to select/deselect individual files

Create Branch Before Commit

You can create a new branch as part of the commit flow:

  1. Enable the Create new branch toggle
  2. Enter a branch name (e.g., feature/my-feature)
  3. The branch is created and checked out before committing

Branch Naming

Branch names can contain letters, numbers, dots, underscores, slashes, and hyphens. Use a consistent naming convention like feature/, fix/, or chore/.

Branch Management

Tap the branch icon in the Git panel header to open the branch selector:

Viewing Branches

The branch selector shows all local branches with the current branch highlighted.

Switching Branches

  1. Open the branch selector
  2. Tap any branch to switch to it
  3. The Git panel refreshes to show the new branch's status

Creating New Branches

  1. Tap Create New Branch at the top of the branch list
  2. Enter the branch name
  3. Tap Create & Checkout
  4. The new branch is created from HEAD and checked out immediately

Uncommitted Changes

Switching branches with uncommitted changes may fail. Commit or stash your changes first, or ask the agent to help manage the branch switch.

Pull Requests

Create and view pull requests directly from C3 (requires GitHub CLI):

Creating a PR

  1. Tap the PR icon in the Git panel header
  2. Select the base branch (target for merge)
  3. Enter a title (required) and description
  4. Optionally check Create as draft PR
  5. Tap Create PR

Branch Flow Visualization

The PR creation modal shows a visual flow:

  • From: Your current branch
  • Into: The base branch you select

Viewing Existing PRs

If a PR already exists for your current branch:

  • The PR icon is highlighted
  • Tapping it opens the PR in your browser

GitHub CLI Required

Make sure you have the GitHub CLI installed and authenticated before using PR features. See the setup instructions at the top of this page.

Syncing with Remote

Tap the sync icon (arrows) in the Git panel header to sync with the remote:

What Sync Does

  • Pulls changes from the remote branch
  • Pushes your local commits to the remote
  • Shows a summary of commits pulled and pushed

Sync Status Messages

  • "Already up to date" — No changes to sync
  • "Synced: X pulled, Y pushed" — Success with counts

Handling Conflicts

If sync fails due to merge conflicts:

  • An error modal shows the conflicted files
  • Resolve conflicts on your desktop using your preferred tool
  • Commit the resolution and try syncing again

Branch Tracking

The Git panel header shows your current branch with ahead/behind indicators (e.g., "main ↑2 ↓1") so you know when you need to sync.