GitButler ⧓

Commands
>_

but rub

Combines two entities together to perform an operation like amend, squash, stage, or move.

The rub command is a simple verb that helps you do a number of editing operations by doing combinations of two things.

For example, you can "rub" a file onto a branch to stage that file to the branch. You can also "rub" a commit onto another commit to squash them together. You can rub a commit onto a branch to move that commit. You can rub a file from one commit to another.

Operations Matrix

Each cell shows what happens when you rub SOURCE → TARGET:

SOURCE ↓ / TARGET →  │ zz (unassigned) │ Commit     │ Branch      │ Stack
─────────────────────┼─────────────────┼────────────┼─────────────┼────────────
File/Hunk            │ Unstage         │ Amend      │ Stage       │ Stage
Commit               │ Undo            │ Squash     │ Move        │ -
Branch (all changes) │ Unstage all     │ Amend all  │ Reassign    │ Reassign
Stack (all changes)  │ Unstage all     │ -          │ Reassign    │ Reassign
Unassigned (zz)      │ -               │ Amend all  │ Stage all   │ Stage all
File-in-Commit       │ Uncommit        │ Move       │ Uncommit to │ -

Legend:

  • zz is a special target meaning "unassigned" (no branch)
  • - means the operation is not supported
  • "all changes" / "all" refers to all uncommitted changes from that source

Examples

Squashing two commits into one (combining the commit messages):

but rub 3868155 abe3f53f

Amending a commit with the contents of a modified file:

but rub README.md abe3f53f

Moving a commit from one branch to another:

but rub 3868155 feature-branch

Usage: but rub <SOURCE> <TARGET>

Arguments

  • <SOURCE> — The source entity to combine (required)
  • <TARGET> — The target entity to combine with the source (required)

Last updated on

On this page

Edit on GitHubGive us feedback