Diff and Merge
Review Git changes, stage hunks, and inspect AI-proposed edits in comparison views.
Shape shows file differences in dedicated diff tabs so you can review changes before committing or keeping AI edits.
Git diff tabs
From Source Control, click a changed file to open a diff tab. Tabs are labeled with the filename and context:
| Label | Meaning |
|---|---|
| Working Tree | Unstaged changes vs the index |
| Index | Staged changes vs the last commit |
The diff view uses Monaco's inline comparison with added and removed highlighting.
Hunk actions
A toolbar follows the hunk under the cursor:
| Diff | Button | Shortcut |
|---|---|---|
| Working Tree | Stage | Ctrl+Y |
| Working Tree | Restore | (toolbar) |
| Index | Unstage | Ctrl+Shift+Y |
The label shows Hunk N/M. Select changed lines to stage, unstage, or restore only that selection instead of the whole hunk.
Unstaged and staged diffs open as separate tabs so you can compare both states.
Open diffs from Git Graph
In the Git Graph, right-click a commit and choose Compare with Working Tree or View Changes to inspect historical diffs.
AI edit previews
When AI chat edits files, each change appears as a review card after it is written to disk (unless you require approval first).
- Click the file in the pending strip to open a diff in the editor.
- Compare the latest step against the previous version.
- Keep leaves the file as written. Undo restores the baseline from before the unresolved edit chain.
See Reviewing Edits for Keep/Undo and optional pre-write approval.
Merge conflicts
If a git pull or merge produces conflicts, Shape surfaces conflict markers in the affected files. Open the file in the editor and look for standard conflict sections:
<<<<<<< HEAD
your changes
=======
incoming changes
>>>>>>> branchResolve conflicts manually in the editor, then stage the file and commit. Shape does not yet provide a dedicated three-way merge UI. Use the diff tabs and editor for manual resolution.
Tips
- Close diff tabs with Ctrl+W when review is done.
- Enable Git: Blame in settings to see line attribution while reviewing changes.