carapace-sh/carapace-bin / skills/but
but
VerifiedUse 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".
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 5.5 KB |
| references/ai-agents.md | markdown | 6.2 KB |
| references/branches.md | markdown | 5.4 KB |
| references/commits.md | markdown | 6.9 KB |
| references/config.md | markdown | 4.5 KB |
| references/conflicts.md | markdown | 2.1 KB |
| references/forge.md | markdown | 3.6 KB |
| references/inspection.md | markdown | 4.5 KB |
| references/misc.md | markdown | 3.4 KB |
| references/oplog.md | markdown | 3.3 KB |
| references/rubbing.md | markdown | 3.0 KB |
| references/tui.md | markdown | 2.1 KB |
| references/workspace.md | markdown | 4.6 KB |
references/oplog.md
View on GitHub# Operations Log — Undo, Redo, and Snapshots
The operations log tracks every workspace operation, enabling undo/redo and restoration to any previous state.
> **Source of truth**: <https://docs.gitbutler.com/cli-guides/cli-tutorial/operations-log>
## Concept
Every operation that modifies the workspace (commits, amends, squashes, moves, branch operations, discards) is recorded as an **oplog entry**. Each entry has an ID, timestamp, operation type, and title. You can restore the workspace to any previous entry.
## `but oplog` — Show Operation History
```bash
but oplog # Show operation history
```
Parent command for oplog subcommands. Without a subcommand, lists operations.
### `but oplog list`
List operation history entries.
```bash
but oplog list
but oplog list --since <entry-id>
```
| Flag | Description |
|------|-------------|
| `--since` | Show entries since this oplog entry |
### `but oplog restore`
Restore the workspace to a specific oplog snapshot.
```bash
but oplog restore <entry-id>
```
Positional argument is the oplog entry ID to restore to.
### `but oplog snapshot`
Create a manual savepoint in the operation history.
```bash
but oplog snapshot
```
Useful before large history edits (squashing, moving multiple commits) as a recovery point.
## `but undo` — Undo Last Operation
```bash
but undo
```
Reverts to the previous snapshot. Undo the last operation by reverting to the previous state. Multiple `but undo` calls walk backwards through history.
## `but redo` — Redo Last Undo
```bash
but redo
```
Redo the last undo. Walks forward through history after undoing.
## Operation Types
Each oplog entry has an operation type:
| Operation | Style | Description |
|-----------|-------|-------------|
| `CreateCommit` | green | New commit created |
| `CreateBranch` | magenta | New branch created |
| `AmendCommit` | yellow | Commit amended |
| `UndoCommit` | red | Commit undone |
| `SquashCommit` | default | Commits squashed |
| `UpdateCommitMessage` | yellow | Commit message edited (reword) |
| `MoveCommit` | cyan | Commit moved |
| `RestoreFromSnapshot` | red | Restored from snapshot |
| `ReorderCommit` | cyan | Commit reordered |
| `InsertBlankCommit` | default | Blank commit inserted |
| `MoveHunk` | cyan | Hunk moved between commits |
| `ReorderBranches` | default | Branches reordered |
| `UpdateWorkspaceBase` | default | Workspace base updated |
| `UpdateBranchName` | default | Branch renamed |
| `GenericBranchUpdate` | default | Branch updated |
| `ApplyBranch` | default | Branch applied |
| `UnapplyBranch` | default | Branch unapplied |
| `DeleteBranch` | default | Branch deleted |
| `DiscardChanges` | default | Changes discarded |
## JSON Output
```bash
but --format json oplog
```
Returns an array of entries with `id`, `createdAt`, and `details` (containing `operation`, `title`, `body`, and `trailers`).
## Workflow
```
but oplog snapshot # Create savepoint before risky edit
but squash <a> <b> # Perform the edit
but undo # If something went wrong, undo
but oplog restore <id> # Or restore to specific point
but redo # Redo if you undid too far
```
## Related
- [commits.md](commits.md) — Commit operations that generate oplog entries
- [conflicts.md](conflicts.md) — Conflict resolution operations
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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: 472k | Updated | Claude CodeCodex | Verified | Install |
| 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: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| 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 available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |