by Scott Chacon

4 min read

GitButler 0.23 - "Air Jordan"

The newest GitButler release brings less gitbutler/workspace, worktree support, a much more capable CLI and TUI, and an early look at a new gpui based desktop client.

GitButler 0.23 - "Air Jordan"

Today we released GitButler 0.23, which includes some pretty amazing new functionality. Here's a rundown of the major things that have landed since 0.22.3.

No more gitbutler/workspace (mostly)

This has been a big annoyance for a while now.

Whenever you are working in a git repository with GitButler, we have switched you into a branch called gitbutler/workspace that has a merge commit on top of it that all parallel branches are automatically merged into. This is because we want a normal git status call to show what is expected, even with work committed on multiple branches.

However, if you only have a single branch in your workspace, it's unneccesary and annoying. The 0.23 release removes this issue. Now if you are on a single branch, you can use GitButler and not have to worry about that weird integration commit.

No more gitbutler/workspace when you're on one branch
No more gitbutler/workspace when you're on one branch

This also removes the need to run but setup to get into "gitbutler" mode. Just run GitButler anywhere and it won't mess with your HEAD.

I say "mostly" because if you do add more parallel branches, we will still add the gitbutler/workspace integration commit, but when you're back down to one it will be removed again.

Worktrees

This release adds new worktree support, which means now you can use parallel branches in your main workspace, have isolated branches in a seperate worktree directory, or all of the above.

A workspace with three branches and one isolated worktree
A workspace with three branches and one isolated worktree

This gives GitButler the flexibility to use any branching strategy to get your work done:

  • Parallel branches to work on unrelated things in a single working directory with shared resources and artifacts
  • Stacked branches to work on related things in seperately reviewable changes
  • Worktree branches (or stacked worktree branches) to isolate changes from each other for testing or best-of-N type problems

Work can be easily and seamlessly moved between worktrees and your main workspace and back. This means that individual changes, commits or whole branches can move between these areas with a simple but move command.

We also support a .worktreeinclude file, which will copy ignored files or directories into new worktrees. What's more, if your filesystem supports copy on write cloning, we will do that too. So go ahead and copy your Rust project's target/ directory to each worktree for faster builds.

Worktrees also support undoing, just like work in your main workspace.

Here's the whole loop in a small Rust project, with a humidity branch already in the main checkout.

1/9

List ignored paths that new worktrees should get a copy of. Here, Cargo's 93 MB build directory.

❯ ▋
❯ but worktree new cli-help
❯ cd ~/.gitbutler-worktrees/weather/cli-help
❯ cargo build

The CLI

There are also a number of new commands and capabilities in the GitButler but CLI.

It used to be a little awkward to initialize a new project as a git repository and start using GitButler to manage it. Now there is a but init command to do that for you.

There is also a new but split command that can take hunks out of a commit and extract them into a new commit anywhere in your stack.

Speaking of hunks, but diff now shows stable hunk IDs that can be moved around, discarded, squashed or split out from within a commit or file.

Projects now use a local target branch, so but pull and but merge can work in repositories with no remote. This used to be a big issue trying to use GitButler in new repositories when you hadn't pushed them somewhere. Now you can have your target branch be something like a local main rather than needing it to be origin/main. but pull also moves a checked-out target branch along with it automatically.

One final small change - the uncommitted area's ID is now @ instead of zz.

Here's most of that in one go: a brand new repository with no remote, a commit that turns out to be two commits, and a merge.

1/7

but init creates a new Git repository. There's no setup step after it, because GitButler works in any repository.

❯ ▋
❯ vim README.md src/cli.js src/store.js
❯ but status
❯ but commit -m "Start a notes CLI"

The TUI

The TUI also got a lot of love in the last few months.

Obviously, it also gained worktree support so you can create, discard, archive (remove from the view without deleting) or unarchive a project's worktrees.

Create a worktree, move a commit into it, commit local changes straight to it, then archive it. All without leaving the TUI.

It can also now mark, move, squash and discard committed hunks in the details view.

Cleaning up a commit that swept up too much: discard a stray dbg!, squash a fix into the commit below, and move two README hunks to the docs branch.

Also lots of other cool things - you can use the mouse-wheel and click rows to select. You can move a commit's files to another commit, a branch or a new branch. In move mode, b moves commits onto a new branch above the selected one. Cherry-pick commits onto new unstacked branches. The list goes on.

Under the hood

Of course, also lots of bug fixes and cool smaller details.

  • gix 0.90, with a roughly 35% faster object database.
  • Faster refreshes in Git LFS repositories and after undo, and faster workspace updates in repositories with many pack files.
  • SHA-256 repositories now support commit signing, rewording, undo and push.
  • Commit signing honors more Git settings, including X.509 signing and gpg.ssh.defaultKeyCommand.
  • Workspace update previews no longer sign their temporary commits, and a failed preview signature no longer turns signing off.

Early look: GitButler Native

Just one more thing.

We have been experimenting with a native GPUI based GUI to replace the Tauri based desktop app. It's incredibly fast, sports a brand new multi-project layout, and does nearly everything our current desktop app does.

GitButler GPUI native app
GitButler GPUI native app

If you would like to try it out, you can switch to this new interface in the settings under Experimental.

Turn on the experimental new native desktop UI
Turn on the experimental new native desktop UI

Restart the app and you'll be using the new UI. You can easily switch back.

Play with all this 0.23 goodness today and let us know what you think!

Scott Chacon

Written by Scott Chacon

Scott Chacon is a co-founder of GitHub and GitButler, where he builds innovative tools for modern version control. He has authored Pro Git and spoken globally on Git and software collaboration.

Stay in the Loop

Subscribe to get fresh updates, insights, and
exclusive content delivered straight to your inbox.
No spam, just great reads. 🚀