Skip to content

Git Integration

Snowy edited this page Feb 15, 2026 · 1 revision

Git Integration

SnCode includes built-in Git integration for managing your project's version control directly from the app.

Requirements

  • Git must be installed and available in your system PATH
  • The project folder should be a Git repository (or you can initialize one from SnCode)

Features

Branch Management

The top bar shows the current branch name. Click it to open a dropdown with all local branches and switch between them.

Status Indicators

The top bar displays real-time change indicators:

  • Amber badge — Number of modified/untracked files
  • Green badge — Number of staged files

Status refreshes automatically when the agent finishes a run.

Diff Viewer

Click the Git icon in the top bar to open the diff viewer in the right sidebar:

  • File tree — All changed files grouped by directory
  • Status badgesM (modified), A (added), D (deleted), R (renamed)
  • Line-by-line diff — Side-by-side old/new line numbers
  • Color coding — Green for additions, red for deletions
  • Hunk headers — Collapsible section headers showing context

Click a file in the diff tree to view its specific changes.

Git Actions

Action Description UI Location
Init Initialize a new Git repository Shown when project has no .git directory
Commit Stage all changes and commit with a message Commit button opens a message input modal
Pull Pull from remote Action button in Git panel
Push Push to remote Action button in Git panel
Stash Stash current changes Action button in Git panel
Stash Pop Apply stashed changes Action button in Git panel
Checkout Switch to a different branch Branch dropdown selector

Commit Flow

  1. Click the commit button in the Git panel
  2. Enter a commit message in the modal
  3. SnCode runs git add . followed by git commit -m "your message"
  4. The diff viewer and status indicators refresh automatically

How It Works

Git operations are handled via IPC calls from the renderer to the main process:

IPC Channel What It Does
git:branches Runs git branch --no-color, parses current and all branches
git:status Runs git status --porcelain, counts changes
git:diff Runs git status --porcelain then git diff per file
git:action Dispatches to the appropriate git command

All Git commands are executed in the project's root directory using child_process.execFile.

Limitations

  • Only local branches are shown (no remote branch listing)
  • Merge conflict resolution is not handled in the UI — use the AI agent or your preferred tool
  • SSH authentication must be configured separately in your system
  • Large diffs may be truncated for display performance

Clone this wiki locally