GitButler ⧓

GitButler CLI Cheat Sheet

Essential commands for working with GitButler

GitButler is a Git client that allows you to work on multiple branches simultaneously. This cheat sheet features the most important and commonly used GitButler CLI commands for easy reference.

Setup and Teardown

Switching to and from GitButler branch management

but setup

Switch to GitButler in the current repository

but teardown

Go back to vanilla git branch management

Branch Management

Create and manage parallel and stacked branches

but branch

List all branches available

but branch new [name]

Create a new parallel branch

but branch new --anchor [branch]

Create a new stacked branch from an existing branch

but branch apply [branch]

Apply (enable) a branch to your working directory

but branch unapply [branch]

Unapply (disable) a branch from your working directory

Remote Operations

Push changes and interact with forges

but push

Push all branches with unpushed commits

but pull

Pull latest upstream and integrate all active branches

but pr

Create/update pull requests for active branches

but config forge

View and modify forge authentications

Conflict Management

Resolve conflicts and manage merges

but resolve

Go into resolution mode

Inspection

View your workspace state and changes

but status

Show workspace state, applied branches, staged files, and commits

but status -f -v

Show status with committed files listed and more verbose output

but diff

Show changes in working directory compared to last commit

but show [commit|branch]

Show details of a specific commit or branch

Committing Changes

Create commits on your branches

but commit -m "[message]"

Commit all changes to current branch with a message

but stage [file] [branch]

Stage specific file(s) for the next commit

but commit --only [branch]

Commit only changes already staged to the branch

Operations Log

View and restore workspace history

but undo

Undo the last operation

but oplog

Show operation history of workspace

but oplog restore [snapshot-id]

Restore workspace to a specific snapshot

Helper Commands

Other miscellaneous commands including automatic file assignment or committing

but gui

Open the GUI to the current project

but alias

Create and manage aliases for commonly used commands

but config

View and modify GitButler configuration settings