GitButler Logo
FeaturesBranch Management

Virtual Branches

Virtual branches are a powerful feature of GitButler that allow you to work on multiple branches at the same time, committing to them independently and simultaneously. This is a key part of the GitButler experience, allowing you to manage your work in a flexible and efficient way that is not possible with traditional Git tooling.

Overview

With normal Git branching, you can only work on one branch at a time. There is one HEAD reference and one index.

With virtual branches, you can have multiple branches applied to your working directory at the same time. Each branch is represented as a vertical lane, and you can drag changes between these lanes to commit them independently.

Each lane also has it's own staging area, so you can stage changes for each branch before deciding to commit them.

A project with three simultaneous branches, plus some staged changes in each one and some unstaged (unassigned) changes.
A project with three simultaneous branches, plus some staged changes in each one and some unstaged (unassigned) changes.

How it works

Let's say that you make changes to two different files and git status would list two modified files. In GitButler, you can "assign" the change in each file to a different "virtual" branch, then when you commit, it will create a commit that only contains the changes in that file for that branch.

One of the nice things with this approach is that since you're starting from changes in a single working directory, you can be sure that all branches that you create from it will merge cleanly, as you're essentially starting from the merge product and extracting branches of work from it.

Last updated on

On this page

Edit on GitHubGive us feedback