Skip to content

carapace-sh/carapace-bin / skills/but

Use when working with the GitButler CLI (`but`) — virtual branches, stacked branches, workspace model, commit editing (rub, amend, squash, reword), CLI IDs, forge integration, PRs, operations log, conflict resolution, TUI, AI agent setup, skills, aliases, configuration. Triggers on: "but", "gitbutler", "but rub", "but commit", "but status", "but branch", "but apply", "but unapply", "but push", "but pull", "but pr", "but oplog", "but undo", "but redo", "but resolve", "but stage", "but squash", "but amend", "but reword", "but config", "but alias", "but setup", "but teardown", "but tui", "but diff", "but show", "but agent", "but skill", "but clean", "but move", "but pick", "but absorb", "but update", "but completions", "virtual branch", "stacked branch", "integration branch", "gitbutler workspace", "but oplog restore", "but oplog snapshot", "CLI ID", "hunk ID".

FileKindSize
SKILL.mdskill md5.5 KB
references/ai-agents.mdmarkdown6.2 KB
references/branches.mdmarkdown5.4 KB
references/commits.mdmarkdown6.9 KB
references/config.mdmarkdown4.5 KB
references/conflicts.mdmarkdown2.1 KB
references/forge.mdmarkdown3.6 KB
references/inspection.mdmarkdown4.5 KB
references/misc.mdmarkdown3.4 KB
references/oplog.mdmarkdown3.3 KB
references/rubbing.mdmarkdown3.0 KB
references/tui.mdmarkdown2.1 KB
references/workspace.mdmarkdown4.6 KB

references/rubbing.md

View on GitHub
# Rubbing — The `but rub` Command

`but rub` is GitButler's powerful commit editing tool. "Rubbing" is combining two entities together — depending on what you rub into what, different operations happen automatically.

> **Source of truth**: <https://docs.gitbutler.com/cli-guides/cli-tutorial/rubbing>

## Concept

The key insight is that all commit editing operations (amend, squash, move, stage, uncommit) are fundamentally the same operation: **combine entity A with entity B**. The type of each entity determines the operation.

## Operation Matrix

| Source (arg 1) | Target (arg 2) | Operation |
|----------------|----------------|-----------|
| File/hunk change | Branch | **Stage** — assign changes to a branch |
| File/hunk change | `zz` | **Unassign** — move changes back to unassigned |
| File/hunk change | Commit | **Amend** — add changes into an existing commit |
| Commit | Commit | **Squash** — merge two commits into one |
| Commit | `zz` | **Uncommit** — put commit changes back to unassigned |
| Commit | Branch | **Move** — move a commit to another branch |
| File change ID | Commit | **Move file** — move a specific file change from one commit to another |

## Usage

```bash
but rub <source> <target>
```

Two positional arguments, both can be CLI IDs or names:

- **Arg 1 (source)**: CLI IDs (changes, commits, branches) or local branch names
- **Arg 2 (target)**: CLI IDs (branches, stacks, commits) or local branch names

### The `zz` Target

`zz` is the special CLI ID for the **unassigned area** — changes that aren't assigned to any branch. Rubbing something into `zz` moves it to unassigned. Rubbing `zz` as a source isn't valid — use `but stage` or `but rub <change> <branch>` instead.

## Common Workflows

### Stage a File to a Branch

```bash
but rub <file-id> <branch>
# Equivalent to: but stage <file> <branch>
```

### Amend a Commit

```bash
but rub <file-id> <commit-sha>
# Equivalent to: but amend -p <file-id> <commit-sha>
```

### Squash Two Commits

```bash
but rub <source-commit> <target-commit>
# Equivalent to: but squash <source> <target>
```

### Move a Commit to Another Branch

```bash
but rub <commit-sha> <branch>
# Equivalent to: but move <commit> <branch>
```

### Uncommit Changes

```bash
but rub <commit-sha> zz
# Equivalent to: but uncommit <commit-sha>
```

### Unassign Changes

```bash
but rub <file-id> zz
# Moves changes back to unassigned
```

### Split a Commit

```bash
but commit empty --after <sha>     # Create blank commit
but rub <file-id> <blank-commit>   # Move specific changes into it
```

## CLI IDs in Rub

`but rub` uses CLI IDs extensively. These are short identifiers (e.g. `h0`, `i0`, `c3`, `b1`) shown in `but status -f` output. The `--format json` output also includes `cliId` fields. See [inspection.md](inspection.md) for the full CLI ID reference.

## Related

- [commits.md](commits.md) — Dedicated commit commands (amend, squash, move, etc.)
- [inspection.md](inspection.md) — CLI IDs and status output
- [tui.md](tui.md) — Interactive rubbing in the TUI
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexUnverifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall