# Using parterre The [README](../README.md) shows what parterre is for. This guide covers every option, key and window. - [Starting it](#starting-it) - [The graph](#the-graph) - [Branches and worktrees](#branches-and-worktrees) - [Pull requests](#pull-requests) - [Upstreams](#upstreams) - [The log](#the-log) - [Diffs](#diffs) - [Comparing commits](#comparing-commits) - [Blame](#blame) - [Settings](#settings) - [Colours](#colours) ## Starting it ```sh parterre [PATH] # open the repository containing PATH (default: the # current directory's, or none: the window asks for one) parterre --mode forks # also show where labelled histories fork apart parterre --mode all --no-remotes # every commit, local branches and tags only parterre --look classic # straight, unbundled edges like TortoiseGit parterre --hide 'pipeline/*,release/*' # leave out build and release branches parterre --branch-color 'feature/*=#9b59b6' # colour branches by name (repeatable) parterre --pull-requests # show GitHub pull requests even if turned off in settings parterre --worktrees # show worktrees even if turned off in settings parterre --export graph.svg # write an SVG without opening a window parterre --export graph.png --zoom 2 # or a PNG (or .webp), here at 200% parterre --help # all options ``` The installers also add *Revision Graph* to the folder menu of Explorer, Nautilus, Dolphin and Nemo. `Ctrl+O` (`⌘O` on macOS) opens another folder, as does dropping a folder (or a file in it) on the window from a file manager (on Windows, macOS and X11; not yet on Wayland, where winit 0.30 takes no drops), and *File › Open recent* lists the recent ones. On macOS, drop a folder on parterre's Dock icon, choose parterre in Finder's *Open With*, or pick *Revision Graph* in the *Services* (or *Quick Actions*) of a folder's menu in Finder. *File › Clone repository…*, also on the start screen, clones a repository from any URL git takes (GitHub, Azure DevOps or any other host) into a new folder, and opens it. The URL is typed in its first tab. Each forge has a tab of its own, listing your repositories there to search and pick from (Ctrl+Tab goes to the next tab): - **GitHub**, with the GitHub CLI signed in (`gh auth login`). The URLs are HTTPS or SSH as `gh config get git_protocol` says. - **Azure DevOps**, for the organisations git has a sign-in for: those Git Credential Manager has settings for (`credential.azrepos:org/…`), and those of the remotes of repositories you opened before. The URLs are HTTPS, as Azure DevOps gives them. Until its list has come, a forge's tab says it is loading; without a sign-in, it says how to sign in. Credentials come from git's credential helpers, as for fetching. A clone that fails or is cancelled leaves no folder behind. If the clone's folder is there already, *Open* beside the message opens it instead. ## The graph parterre shows the commits that have a branch, a tag or a worktree on them, and leaves out the commits in between, as TortoiseGit's revision graph does. *Labelled forks* adds the commits where their histories fork apart: a branch that merged its base back in forks off at the latest such merge, as if rebased. *Branchings and merges* (in the *View* menu) adds every fork point and merge, as TortoiseGit's "Show branchings and merges" does, and *All commits* shows everything. Hover an edge to list the commits collapsed into it; click it to keep it highlighted while you look around. | Do | To | |---|---| | Drag a node | Move it, with the rest of the selection it belongs to. In *Adapt*, the graph gives way and keeps children above their parents. | | `1` / `2` / `3` | Drag mode *Adapt* (the graph gives way) / *Free* (nothing else moves) / *Subtree* (take along everything that grows out of it) | | Click, `Ctrl`+click (`⌘`-click on macOS), `Shift`+click a node | Select it / toggle it / add it to the selection | | `Shift`+drag the background | Select the nodes in a rectangle | | Hover / click an edge | List the commits collapsed into it / keep it highlighted while you look around | | `Ctrl+Z` / `Ctrl+Y` on Windows, `Ctrl+Shift+Z` on Linux (`⌘Z` / `⇧⌘Z` on macOS) | Undo / redo a move | | Drag the background, wheel, Shift+wheel | Pan | | Ctrl+wheel (`⌘`+wheel on macOS), pinch, `Ctrl`+`+` `-` `0` (`⌘+` `⌘−` `⌘0`) | Zoom | | Ctrl+wheel (`⌘`+wheel), pinch anywhere but over the graph | Text size of every window (also *Settings → Appearance*, and `Ctrl`+`+` `-` `0` (`⌘+` `⌘−` `⌘0`) in the log, compare, diff, blame and settings windows). The graph keeps its own zoom. | | `F`, double-click the background | Zoom to fit the whole graph | | `H` | Go to HEAD | | `Ctrl+F` (`⌘F` on macOS), then `Enter` / `Shift+Enter` | Find branches, tags, hashes, subjects or authors | | `F3` / `Shift+F3` (`⌘G` / `⇧⌘G` on macOS) | Next / previous search hit, in every window that finds | | `L`, double-click a node | Show log: the node's history, or with two nodes selected the commits between them (first..second) | | `Ctrl+C` (`⌘C` on macOS) | Copy the selected commit's hash | | Click a pull request's number | Open the pull request on GitHub | | The *Git* menu | On the selected node: show log; compare with HEAD, the working tree or the upstream (with two nodes, with each other); go to, add or delete a worktree; switch to it, set an upstream, create, reset to or delete a branch; merge, cherry-pick or rebase; fetch, pull or push. With several nodes, delete the worktrees, local or remote branches they all have | | Right-click a node | What the *Git* menu offers for it, under the same headings, without what doesn't apply (pull only on the current branch), and *Mark for comparison*; *Actions* › copy its hash, ref names or folder, open its pull requests or its worktree's folder; select its subtree, return it to the layout, centre the view on it. With several nodes, what acts on them all | | `Shift+F10`, the Menu key (Windows) | The right-click menu of what has the keyboard: the selected node, or a list's selected row, in any window | | `Esc` | Clear the selection | | `F5`, `Ctrl+R` (`⌘R` on macOS) | Reload the repository (it also reloads by itself when branches, tags or HEAD change), in every window that reloads | | `Ctrl+F5` (`⇧⌘F` on macOS) | Fetch every remote, from any window | | `Ctrl+O` / `Ctrl+W` (`⌘O` / `⌘W` on macOS) | Open / close a folder | | `Ctrl+,` (`⌘,` on macOS) | Settings | | `Esc` (`⌘W` on macOS) | Close the log, compare, diff, blame or settings window | | `Alt`+letter, `F10` or `Alt` alone (`⌃F2`, `⇧⌘/` on macOS) | The menu bar from the keyboard: `Alt` with a menu's underlined letter opens it and a letter in it chooses an item; the arrow keys move, `Enter` chooses, `Esc` closes. On macOS, `⌃F2` reaches the menu bar and `⇧⌘/` searches every menu for a command by name | When you drag a node, edges at moved nodes are routed afresh through the gaps between nodes, so they lose bends they no longer need and go around nodes that are now in the way. With *Remember moved nodes* on (*Settings → Dragging*), parterre keeps your arrangement for each repository; new commits keep their place beside a moved parent. The toolbar holds what you use every day, the menu bar has all of that and more, and *Settings* the rest. The menu bar is *File*, *Edit*, *View*, *Git*, *Layout* and *Help*, above the toolbar on Windows and Linux; on macOS it is the system's, with *parterre* (Settings, *Install Command Line Tool…*) and *Window* besides. Its commands act on the window in front: with the log in front, *Find* finds in the log and *Close Window* closes it, and what only the graph does is greyed out. The graph shows every change while the settings are open. Besides TortoiseGit's options (branchings and merges, local and remote branches, tags, arrows towards merges, zoom, the overview map and export), there are: - four directions and three vertical placements; - the default branch as one straight line down the middle, its branches on either side (*Settings → Advanced*; or leftmost, bending like the others, as before); - edge bundling, row splitting and curved edges; - a first-parent-only view, and stashes or other refs; - hiding branches by wildcard, e.g. `pipeline/*` (the toolbar's filter button, or *Settings → Filters*). A hidden branch still shows where the history of a shown branch contains it, so only leaves vanish; - colours by branch name, e.g. `feature/*` purple (*Settings → Branch colours*); - light and dark themes. ## Branches and worktrees Everything parterre changes, it changes with git, in the **open worktree**: the one you opened, marked with a folder on its HEAD. Each dialog shows the git command it runs, under *Git command*. A dialog with a list or a message can be resized; its list or message takes the room, and it opens as wide as you left it last time. **Worktrees** are off by default; the toolbar's folder button shows them. Each one is marked with a folder, first on its commit, in the graph and in the log, in cyan: the branches they have checked out, even where hidden, and detached ones with the folder's name in italics. The open worktree's branch stays red, as HEAD. A worktree whose folder is gone gets a crossed-out folder and a greyer fill. From a node's menu (or the *Git* menu, on the selected node): - *Add worktree at main…* (*here…* in the log) makes a new worktree at the commit, on a new branch that can track a remote one, in a folder next to the repository's (`.worktrees/` unless you pick another). Tick *Go to new worktree* to make it the open one. - *Go to worktree* makes another worktree the open one. The layout, the view, moved nodes and open windows stay: it is the same history. - *Delete worktree* deletes one, with its folder, after asking. With several nodes selected that all have worktrees, *Delete N worktrees* deletes them all after one question, which lists what each would lose. Tick *Also delete local branch* there to delete their branches too; the question then counts the commits only those branches had. - *Actions* › *Open in file manager* / *Open in terminal* opens its folder; *Copy folder path* copies its path. **Branches:** *Create branch at main…* (*here…* in the log; optionally switching to it), *Switch to* a branch or a commit (detached), and *Delete* it. With several nodes selected that all have local branches, *Delete N local branches* deletes them all. It asks first only when that loses commits, and then it lists each branch's. **The open worktree's branch**, from the graph and the log: | Menu entry | Does | |---|---| | *Merge into main* › … | Merges a branch or commit into it: fast-forward or a merge commit, with the message to use. | | *Merge main into feature/x…* | Merges it into another local branch the way a pull request does: fast-forward, merge commit, rebase and fast-forward, or semi-linear merge. | | *Rebase main onto* › … | Rebases it onto a branch or commit. Pick, squash or drop each commit first. | | *Cherry-pick feature/x onto main…* | Picks the commits of another branch that it lacks; drop the ones you don't want. `-x` is remembered. | | *Reset main to feature/x…* | `git reset` with the mode you choose (soft, mixed, keep, hard); the dialog lists the files each mode leaves changed, and what would be lost. | | *Revert in main…* (log) | Reverts a commit, with the message git words for it. | Merges, rebases, cherry-picks and reverts offer to stash uncommitted changes first, and to put them back afterwards. A worktree stopped part-way, by a conflict or a `break`, shows it in the graph: a rebase with an orange zigzag from its HEAD (the commits replayed so far) to the branch being rebased, a merge or cherry-pick with an orange dashed arrow to the commit coming in. A banner across the graph says what is stopped and lists the conflicted files; finish or abort it with git, or go to another worktree. It shows at once after parterre's own operations, and after a change made elsewhere once it has lasted a moment, so a slow `git` in a terminal doesn't flash it. The banner's *Compare with working tree* lists HEAD against the working tree, as the graph's menu does. A conflicted file's status is a red box with what each side did to it, ours then theirs: `MM` both modified, `MD` modified by us and deleted by them, `AA` both added, `A·` only ours has it (as after both renamed a file differently), and so on; hover it for `git status`'s words. *Conflicts only*, checked at first, lists just those; each drops out once resolved. A file's menu opens it in your merge tool (`git mergetool`, left running on its own), or its folder in a terminal or the file manager. When no merge tool is configured, parterre lists the installed ones; *Remember this choice* sets `merge.tool` in your global git config. Any conflict but a submodule's can also be finished by taking one side whole: *Use mine (main)* or *Use theirs (feature)*, saying *deleted* where that side deleted the file. In a rebase, *mine* is your branch being replayed. Submodules are left to the terminal. ## Pull requests Open pull requests show as labels on the commits they propose when `origin` is on GitHub and [`gh`](https://cli.github.com) is signed in (`gh auth login`). Hover one for its title, author and branches; click it to open it in the browser. Drafts are greyed out. The toolbar's pull-request button hides them, and if they can't be shown, turning them on there says why. A pull request shows once its branch has been fetched, also with remote branches hidden: its commits come in as its branch's would, and its commit carries the pull request instead of the branch's name. The name filter, the hide list and *current branch only* apply to it as to its branch, and a pull request into a branch on the hide list is hidden too. Only pull requests from `origin`'s branches show: a fork's own, into it or into its parent (whether or not a remote points at the parent), never other forks'. parterre asks GitHub about the fetched branches only, at most once a minute per repository, F5 included, and never without signing in. A push or a fetch that moves a branch of `origin` is asked about once more a minute later, for the pull request opened just after the push. Once less than a tenth of your hourly API allowance is left, it waits for the next hour. When `origin` is on Azure DevOps (`dev.azure.com` or `visualstudio.com`, over HTTPS or SSH), its active pull requests show the same way, except those from forks. parterre signs in with the sign-in git's credential helper already has for `origin`'s HTTPS URL, as Git Credential Manager keeps it once git has fetched over HTTPS, and never asks for one: without it, turning pull requests on gives the command that signs in. One request lists them all. ## Upstreams Hover or select a branch (or its upstream) and the commits between the two are coloured: green ahead, blue behind, red lost to a force push, grey dashed replaced by a rebase. A rebased branch has a dashed edge to its upstream. The status bar shows `branch 3|2` (ahead|behind), the log's branch labels ↑3 ↓2, and *Compare with origin/x* compares the two. On by default (*Settings → Advanced*). ### Squash- and rebase-merged branches A local branch whose upstream is gone, and whose changes are on the default branch all the same, was squash- or rebase-merged: its label is striped, in the graph, the log and the dialogs, and a green dashed arrow goes to the commit it landed as (the squash commit, or the copy of its tip). Merge commits and fast-forwards need none of this: the graph shows where they landed. parterre finds such branches by their patches, with git alone, and asks GitHub or Azure DevOps too (signed in as for pull requests), for a merged pull request from the branch at its tip: it catches conflicts resolved as the pull request was completed. Hovering the branch says which it was, and in which pull request. Deleting it asks as calmly as deleting a merged branch, saying where its changes went, instead of warning that its commits are lost; deleting it together with a branch that isn't merged still warns of that one's commits. Each branch is asked about once, on opening and after fetching, and the answer is kept. Always on. ## The log *Show log* opens a window listing a node's history, or the commits between two selected nodes, like TortoiseGit's log: a graph column, the selected commit's message and the files it changed, which you can sort and filter. The arrow keys move through the commits, `Ctrl+F` (`⌘F` on macOS) finds, `F5` or `Ctrl+R` (`⌘R`) reloads and `Esc` (`⌘W`) closes it. Right-click a row for the same actions as on a node, and to revert the commit or copy its subject. Four layouts arrange its panes: stacked as in TortoiseGit, side by side, details and files below, or files on the right. Pick one in the window's header or in *Settings → Appearance*; the dividers between the panes are remembered for each layout. ## Diffs Double-click a changed file, or select some (`Ctrl`+click, `Shift`+click) and press `Enter`, to see its diff in a window of its own; several can be open at once. The diff is side by side or unified (`Ctrl+D`, `⌘D` on macOS), with changed words marked, unchanged stretches folded (click a fold to open it), an overview of the changes on the right, and long lines that scroll sideways. Code is coloured by syntax, as in VS Code, for Markdown, Java, C#, Rust, TypeScript, Python, SQL, Protocol Buffers and a dozen more languages, in the blame window too; the palette button in either toolbar turns it off, for both, as does *Syntax colour* in *Settings → Appearance*. `Ctrl+Down` / `Ctrl+Up` (`⌘↓` / `⌘↑`, or `F7` / `Shift+F7`) move between changes, and `Ctrl+F` (`⌘F`) finds. The toolbar also picks how changed words are found and whether whitespace counts. Drag over the old or the new text (double-click for a word, `Shift`+click to extend, `Ctrl+A` (`⌘A`) for all) or click line numbers for whole lines, then `Ctrl+C` (`⌘C`) copies it as it is in the file, tabs kept. In the unified form you choose one version: the one of the line you start on (a removed line, or the old numbers, for the old version; `Ctrl` on an unchanged line for the old one too), shown by its line number lighting up on the row under the pointer. Lines of the other version are left out. Files go through git's textconv filters, as `git show` does; binary files and submodules say what changed instead. ## Comparing commits Comparing two commits lists the files they differ in, in a window with the same table; double-click one for its diff. Right-click a node for *Compare with HEAD*, *Compare with working tree* (your uncommitted changes, staged or not; `F5` lists them again), *Compare with* its upstream, or with two nodes selected *Compare a with b* (the *Git* menu has them too). To compare commits far apart, *Mark for comparison* one (from the node menu or a row in the log) and pick *Compare with marked* on the other, from any log. A range log's *Compare files* compares its two ends. Where the two histories forked, the window's *Since common ancestor* shows only what the right-hand side changed since then, as a pull request does (the working tree forks where HEAD does). *Swap sides* turns a comparison of two commits round; the working tree stays on the right. ## Blame Blame shows which commit last changed each line of a file: right-click a changed file in the log or compare window and pick *Blame*, or click *Blame* in a diff window's toolbar (it opens at the change in view). A gutter names each line's commit, author and date, shaded from plain (oldest) to amber (newest). Click a line to highlight every line of its commit; the strip on the right marks them in the whole file (click it to go there), and the bar at the bottom describes the commit under the pointer. Right-click a line to *Blame previous revision* (the file as it was before that commit, in a new window, at that line), *Show changes* (that commit's diff of the file, at the line), *Show log* from the commit, or copy its hash. Drag or `Shift`+click to choose lines, `Ctrl+C` (`⌘C` on macOS) to copy them. `Ctrl+G` (`⌃G`) goes to a line. The toolbar says whether whitespace changes and moved or copied lines count (`git blame -w`, `-M`, `-C`). Blaming the working tree marks the lines you haven't committed; `F5` or `Ctrl+R` (`⌘R`) blames again. Below the text, the **history pane** lists the commits that changed the file up to the blamed revision, like the log: graph, hash (in its lines' shade), subject, author, date. Commits from before a rename say the path the file had there; commits none of whose lines remain are greyed out; *Working tree changes* sits on top when the file differs from `HEAD`. Clicking a line selects its commit's row, and clicking a row highlights its commit's lines. `Up` and `Down` step through the rows. Right-click a row to *Blame this revision*, *Show changes* (also a double-click), *Show log* or copy its hash. Drag the divider to resize the pane, or hide it with *History* in the toolbar. ## Settings `Ctrl+,` (`⌘,` on macOS) opens the settings; the graph follows every change while they are open. - **Per repository:** filters are kept for each repository, and shared by its worktrees. - **Shared with a team:** *Settings → Manage* exports parterre's own settings, or a repository's filters, to a file that another computer or a whole team can import, choosing what to take. It also resets everything to the defaults. The files are versioned JSON: older and newer versions of parterre read all they know of them. ## Colours Colours follow TortoiseGit: | Label | Colour | |---|---| | Current branch | red | | Local branches | green | | Remote branches | light orange | | Tags | yellow | | Worktrees | cyan when detached | | Pull requests | blue, grey for drafts | | Commits without refs | pale lavender, showing an 8-digit hash | Colours chosen per branch name replace these, except for the current branch. *Help › Legend* shows them all.