Plan du cours

AcadémieModule 6 · Beyond notes

Version control: the built-in Git panel

Leçon 1 sur 412 min

Ce que vous apprendrez

  • You can open the "Source Control" panel and turn any workspace into a Git repository, or publish it to GitHub in one flow.
  • You can stage files, commit with an AI-written message, and push. You can also explain why the Commit button is sometimes greyed out.
  • You can read a side-by-side diff and stage, unstage, or discard one block (hunk) at a time.
  • You can switch, create, and delete branches, and read the color-laned commit graph.
  • You can explain why versioning the markdown alone is enough, since the knowledge graph can always be rebuilt.

It's Friday. On Monday you rewrote the project plan note and deleted two whole sections. Now you need one of those deleted paragraphs back, but Undo stopped being an option four days ago. If your workspace were a Git repository, this would be a thirty-second errand: open the history, find Monday's commit, and read the old text in a diff.

Consilience ships a full Source Control panel that feels like VS Code's Git view. See what changed, stage, commit, push, and pull without leaving the app. An AI can write the commit message, and branches, stashes, and a color-laned commit graph all live in the same panel.

Finding the panel, making a repo

There are three ways into the panel:

  • The titlebar: the segmented control at the top-left has a branch-icon segment (tooltip "Source Control"), next to the chat and file-tree segments.
  • The menu bar: Go → Source Control. There's no default keyboard shortcut for it.
  • The command palette: run "Show source control".

The panel looks for a repository in the open workspace folder or any folder above it, so a workspace inside a bigger repo works fine. No repo at all? An empty state reads "This folder is not a git repository." with two buttons: "Initialize Repository" (runs git init) and "Publish to GitHub" (the one-shot flow below). If Git isn't installed yet, the app notices and a "Get Git" button opens the download page in one click.

Stage, commit, push

The change list groups files exactly like VS Code. Only non-empty groups show up, each with a count badge and actions that appear on hover. Every row shows the filename, its folder (dimmed), +N/−N line counts, and a colored status letter: M modified, A added, D deleted, R/C renamed or copied, T type-changed, and U untracked (green) or conflicted (orange).

GroupWhat lands here
"Merge Changes"Conflicted files during a merge. Fix the conflict markers in the normal editor, then stage the file.
"Staged Changes"Files in the index, which is exactly what the next commit will contain. Hover the header for "Unstage all".
"Changes"Tracked files modified in the working tree. Hover the header for "Stage all changes" and "Discard all tracked changes".
"Untracked"Brand-new files Git doesn't know yet. Stage them to include them in a commit.

Committing is Git's two-step move. Hover a row and click + to stage it, then write a message and hit "Commit". The button stays disabled until both halves exist, and its tooltip says which one is missing: "Stage changes before committing." or "Write a commit message first."

Don't feel like writing one? Click the sparkles icon in the textarea, "Generate commit message". It sends the staged diff to the AI and fills in a Conventional-Commits-style message. The chevron next to Commit opens "Commit & Push" and "Commit (Amend)", and the footer's "Sync changes" button runs pull-then-push at once.

What "Generate commit message" writes: type(scope): summary, imperative, ≤72 chars
docs(plans): fold Q3 scope cuts into the decision log
Staging
Git's two-step commit: you pick changes into the index first (the + actions), then commit only what's staged. Consilience never commits unstaged work.
Hunk (block)
One contiguous run of changed lines inside a diff. The diff tab gives every block its own stage, unstage, and discard buttons.
Stash
Git's shelf for uncommitted work. Both the Stash commands and this app's Discard put changes here; "Pop" brings them back.
Upstream
The remote branch your local branch syncs with. Until a branch has one, the panel shows a Publish action instead of "Sync changes", and the first push sets it for you.
Commit graph
The panel's "Graph" section: recent commits across all refs (branches and tags), drawn as colored branch lanes with ref pills.

Diff tabs: work block by block

Single-click any changed row and a read-only diff opens as a regular tab: filename (Changes) for working-tree edits, filename (Staged) for the index, and the same file can have both open at once. (Double-click opens the file itself.)

The layout is side-by-side by default, with unchanged regions collapsed behind expandable separators. The floating toolbar jumps between changes (F8 / Shift+F8) and toggles side-by-side vs. inline. The overview ruler on the right edge marks every change with a clickable colored dot.

  • In a working-tree diff, every changed block gets gutter buttons: + "Stage this block" and "Discard this block" (confirm: "Discard this block? This change will be lost.").
  • In a Staged diff, blocks get "Unstage this block" instead.
  • This is how you split one messy file into two clean commits: stage only the blocks that belong together, commit, then stage the rest.
  • Bonus: every markdown and code editor shows dirty-diff gutter bars for lines that differ from the file's Git HEAD (green for added, red for deleted), recomputed as you type.

Vérification rapide

You clicked "Discard changes" on a modified note, then immediately regretted it. What now?

Branches and history

The footer's branch button shows the current branch name (or "(no branch)" when you've checked out a commit rather than a branch) plus behind/ahead counts as ↓N ↑N. Click it, or use … → Branch → "Checkout to…", to open the branch picker, where search and create share one box ("Search or create a branch…"). Type a new name and hit Enter for Create branch "{name}". Click a local branch to check it out, or pick one under Remote for a local tracking branch.

Hover a branch to reveal its delete button. If the branch isn't merged, Git refuses and the dialog switches to "Branch not merged". The red "Force delete" button warns that you'll lose that work for good.

At the bottom, the "Graph" section draws recent history across all refs as colored branch lanes with ref pills. The pill colors are the legend: the checked-out branch (HEAD) in blue, remote branches in violet, tags in amber, other local branches in gray. Header icons cover "Go to Current History Item", "Fetch From All Remotes", "Pull", "Push", and "Refresh". The graph is read-only, so the only thing you can do to a commit is right-click → "Copy Commit Hash".

Vérification rapide

You typed a commit message, but the "Commit" button is still disabled. The most likely reason?

GitHub: publish, sign in, PRs

Everything GitHub goes through the official GitHub CLI (gh): publishing, cloning, signing in, and pull requests. If gh is missing you get a "GitHub CLI required" dialog with a "Get GitHub CLI" button. A Homebrew install is found even when you launch the app from the Dock.

Signing in uses GitHub's Device Flow. The "Sign in to GitHub" modal shows a short code (with a "Copy code" button), opens your browser, and waits for approval. It can also fall back to gh auth login in the terminal. The access token goes straight into gh and never appears on screen.

Put a workspace on GitHub in one flow

  1. Start from the empty state

    Open Source Control on a workspace that isn't a repo yet and click "Publish to GitHub". The hint under it explains it: "Publishing initializes the repository, then lets you sign in and push it to a new GitHub repo." The app runs git init for you.

  2. Sign in with a device code

    If gh isn't signed in, the "Sign in to GitHub" modal shows a short code and opens your browser. Enter the code there and wait for "Waiting for approval…" to clear.

  3. Name it, keep it private

    The "Publish to GitHub" dialog pre-fills "Repository name" with the folder name. The "Private repository" toggle is ON by default: "Only you can see it until you change visibility."

  4. Publish

    Click "Publish to GitHub". The app makes an initial commit if the repo has none, creates the GitHub repo, pushes, and toasts "Published to GitHub."

Once the repo is on GitHub, a "Pull Requests" region pins above the graph. Open PRs list with their #number (a green icon for open, gray for draft), and the region's footer shows the signed-in @login. The + button opens a minimal create dialog with Title, Description, and "Create", opening a PR from the current branch into the default branch.

Hover a PR for "Checkout PR" (a local gh pr checkout) or "Open in browser". Cloning lives in the same panel: … → "Clone repository…" takes owner/name or a URL.

One more thing before you go. The chat composer's @ menu has a "Diff with Main" item that attaches your working-tree diff against main to a message, handy for asking the agent to review work you haven't committed yet. Next lesson: the terminal dock the agent shares with you, and how your code becomes part of the knowledge graph.

Version control: the built-in Git panel · Consilience Academy