GitButler ⧓

GuidesCLI Tutorial

Push branches and create reviews

Publish branches, create pull or merge requests, and land work with the GitButler CLI.

Use but push to publish a branch, but pr to create a review, or but land when your project accepts direct updates to the target branch.

Push a branch

Name the branch you want to push:

but push update-homepage

Preview the push without changing the remote:

but push update-homepage --dry-run

In an interactive terminal, bare but push opens a branch picker. In a non-interactive session, it pushes every branch with unpushed commits, so naming the branch is safer in scripts.

Create a pull or merge request

Authenticate with the repository's forge first:

but config forge auth

GitButler supports accounts for GitHub, GitLab, and Bitbucket. The authentication flow offers the methods supported by the selected provider, including self-hosted GitHub and GitLab instances.

Create a review for a branch:

but pr new update-homepage

GitButler pushes the branch before creating its pull request or merge request. Use but mr as an alias when you prefer GitLab terminology.

Pass -t to use the default title and description without prompts:

but pr new update-homepage -t

For a stacked branch, name the top branch. GitButler pushes the whole stack and creates missing reviews from the bottom upward:

but pr new feature-polish -t

Manage forge accounts

Show configured accounts and their authentication status:

but config forge

List accounts or remove one that you no longer use:

but config forge list-users
but config forge forget alice

Land without a review

If your project accepts direct updates to the target branch, land a branch with:

but land update-homepage

This bypasses code review and any checks enforced only by your review workflow. GitButler asks for confirmation because the target update isn't easily reversible.

The target fast-forwards when possible; otherwise GitButler creates a merge commit. After landing, GitButler reconciles the remaining applied branches onto the updated target.

If the remote rejects direct pushes because of branch protection, create a review with but pr new instead. See but land for stack and non-interactive options.

Last updated on

On this page

Edit on GitHubGive us feedback