Skip to content
Versora

Manual

Hygiene and workflow

Fork point

3 min read

On this page

The fork point is the commit a branch started from. Knowing where it is helps answer common questions: how far this branch has drifted from main, whether it started from the right place (a hotfix that started from develop, for example) and which commits really belong to it. Versora marks that commit in the graph with the label "feature/login started here".

Show a branch's fork point

Where to find it

  • Menu: right-click a branch (left panel or graph label) › Show fork point.
  • Palette (Ctrl+P): "Show fork point of the current branch". It's unavailable with the reason "No current branch (detached HEAD)" when no branch is checked out.
  • Branches review: right-click a row › Show fork point, the bar's Show fork point action or the F key. The screen closes and the graph goes to the commit.
  • Automatic: when you select the tip of a branch in the graph (see below).

Step by step

  1. Right-click the feature/login branch › Show fork point.
  2. The graph scrolls to the commit the branch started from and marks it with "feature/login started here".
  3. Hover over the marker to read where it started from and how many commits the branch has had since then, for example "Fork point of feature/login: the commit of main it started from. 7 commits since here."
  4. To remove the marker, click its button ("Remove the marker").

Which branch it started from

Versora picks the source branch in this order, and the marker's tooltip says which one was used:

SituationMarker tooltip
The branch belongs to a stack"Fork point of feature/b: the commit of feature/a (its parent in the stack) it started from."
The repository uses Gitflow"Fork point of feature/x: the commit of develop (Gitflow) it started from."
There's a base chosen in the Branches review"Fork point of feature/x: the commit of origin/main (the branches review base) it started from."
In the other cases"Fork point of feature/x: the commit of main it started from."

Automatic fork point

With the option on (the default), just select the tip of a branch in the graph: the commit it started from gets the marker, without changing the scroll position. The marker goes away when you select something else. The marker requested from the menu, on the other hand, stays until it's closed.

OptionWhereWhat it doesDefault
Mark the fork point of the selected branchPreferences › Branch hygiene › Stale branches and fork point"When you select the tip of a branch in the graph, the commit it started from gets a marker. The branch menu has "Show fork point" to go there."on

What Versora does in git

Read only. Versora runs the two queries below at the same time. When they agree (or only the plain merge-base answers), that's the fork point; when they disagree, the same choice the stacks use to find a branch's base applies:

bash
git merge-base --fork-point main feature/login   # uses main's reflog
git merge-base main feature/login
# the tooltip's count: commits on the branch since the fork point
git rev-list --count <fork-point>..feature/login

How to undo

There's nothing to undo: the marker doesn't change the repository. Close it with "Remove the marker".

Caveats and messages

  • "main is a main branch: it has no fork point.": main branches don't start from another one.
  • "feature/x has no history in common with main.": the branch doesn't share any commit with the chosen source branch.

See also