Graph
The graph
3 min read
The graph is the central area of a repository tab. It shows the history as a list of commits, from newest (at the top) to oldest, with the lines (lanes) that connect each commit to its parents. Each branch, tag and stash appears as a label next to the commit it points to. When there are changes not committed yet, the first row is the // WIP row.
The graph is where you do most of your day-to-day work:
- Read the history: who made each commit, when, on which branch, whether it came in through a merge request, what the description says.
- Navigate: move through the commits with the keyboard, follow a branch along its first parent, go back and forward between selections, pin a branch to the left lane.
- Find: search by message, author, SHA, file, change, date or with operators; highlight the commits of a few people; hide branches, solo one or use a preset.
- Act: right-click any commit, branch, tag or stash to open the context menu; select several commits to combine, drop, cherry-pick or revert them; drag branches and commits to merge, rebase, cherry-pick or push.
| Area | What it shows | Relationship with the graph |
|---|---|---|
| Left panel | The LOCAL, REMOTE, WORKTREES, STASHES, TAGS and other sections, the "Showing N" and the Filter field | Clicking a branch takes the graph to its commit; the eye on each row hides the branch in the graph; you can drag branches from here. |
| Graph (center) | The history in lanes, with configurable columns | Selects the commit that the right panel details. |
| Right panel | The selected commit, the changes of the WIP row or the diff of several selected commits | Follows the graph selection. |
The full tour of the window is in Interface tour.
| Page | What you find |
|---|---|
| The commit graph | How to read the graph: lanes, dots, columns and how to configure them, the BRANCH / TAG column and the counter, the WIP row, branch highlighting, ghost branch, author photos, commit description, MR on the commit, tag annotation, overview bar, "Load more", the footer and Preferences › Graph. |
| Navigating the graph | Arrows, J/K, Shift+J/K, back and forward (Alt+←/→ and the mouse side buttons), going to a commit, checkout with a double-click, pinning a branch to the left and the fork point marker. |
| Search and filters | The search (Ctrl+F) and each "Search by" mode, the operators, the author filter, the panel filter (Ctrl+Alt+F) with the per-remote syntax, hiding with the eye, solo, hiding a whole section, presets and favorites. |
| Multiple selection | Ctrl+click and Shift+click, the selection diff with "Swap sides" and the actions on several commits at once. |
| Context menus | The full list of menu items for each thing (commit, selection, local branch, current branch, remote branch, tag, label, stash, WIP row, section headers), with the condition of each item and the link to the page that explains it. |
| Dragging branches and commits | Branch onto branch (fast-forward, merge, rebase), branch onto remote (push), commit onto branch (cherry-pick without checkout) and commit onto commit (rebase with preview and plan). |
The shortcuts work with the focus on the graph (click a row first). All the ones that aren't fixed can be changed in Keyboard shortcuts.
| Shortcut | What it does |
|---|---|
| ↑ / ↓ or K / J | Previous or next commit. |
| Shift+J / Shift+K | Next commit on the same branch (first parent) / previous commit on the same branch (child). |
| Home / End | First and last loaded commit. |
| PageUp / PageDown | One screen up or down. |
| Shift+↑ / Shift+↓ | Extend the commit selection. |
| Esc | Clear the selection of several commits. |
| Alt+← / Alt+→ | Go back and forward in the graph navigation. |
| Ctrl+F | Search the history. |
| Ctrl+Alt+F | Go to the left panel filter field. |
| Shift+F10 or the Menu key | Open the context menu of the selected commit. |
| Ctrl+Z / Ctrl+Shift+Z | Undo and redo the last operation. |
Tip
Almost everything the graph does is also in the command palette (Ctrl+P): type "Graph:" to see the navigation, preset and column commands, or "Search the graph…" to open the search.