Установка
SKILL.md
GitButler CLI Skill
Use GitButler CLI (but) as the default version-control interface.
Start Here
Choose the narrowest first command by task; avoid ritual status checks:
# Selected dirty files/hunks:
but diff
# Commit order, branch/stack placement, conflict overview:
but status
# File/hunk IDs, per-commit files, amend/split details:
but status -fv
# Details for one known branch or commit:
but show <id>
Do not run plain but status and then but status -fv unless the compact output lacks file/hunk details needed for the task.
For "commit just/only/specific changes on a new branch", use the fast path:
but diff
but commit -b <branch> -m "<msg>" <id> <id>
but commit -b <branch> ... creates the branch when it does not exist and prints the resulting workspace state. Do not run a separate but branch new, staging command, status command, or verification diff unless the returned output lacks information you need.
IDs
The first token on each but diff / but status line is that line's ID — pass it to commands as-is; never hardcode or invent IDs. IDs may be a single character when unambiguous; copy them exactly from command output.
- Changes and sources are positional, space-separated IDs (
but commit -b feat -m "msg" qs:5 uo). A hunk ID is written<file-id>:<hunk-id>(e.g.qs:5, copied frombut diff) — the part after the colon is the hunk's ID, not a line range (qs:16-40is invalid). Do not invent flags like--changes/--hunk/--ids, pass a line range, or comma-separate IDs —nk,pnis parsed as one ID and fails. - A committed file is
<commit-id>:<file-id>(e.g.uyr:n, shown under each commit).zzmeans the uncommitted area. - Commit IDs are stable change IDs that survive history edits (
amend,squash,move,uncommit,reword). Commits without a change ID (e.g. upstream-only) lead with a sha prefix instead, and#N-suffixed refs disambiguate duplicates — both go stale after history edits, and a stale sha can silently resolve to the wrong commit. The(sha …)on verbose commit lines is informational — do not pass it to commands. - File/hunk IDs copied from one diff read generally remain usable across chained commits; branch IDs are stable. If an ID stops resolving, re-read
but status/but diffand retry.
Chaining: you may chain mutations with && off one inspection read. Chained but commit calls stack in the order written — the first is oldest, each later one goes on top. History edits may run in sequence when every commit ref involved is a change-ID ref; run them one at a time when a ref is sha-based or #N-suffixed, or when the next command needs IDs the previous one prints (e.g. recommitting after but uncommit). Take follow-up refs from the returned workspace state.
Non-Negotiable Rules
- Use
butfor all write operations. Never rungit add,git commit,git push,git checkout,git merge,git rebase,git stash, orgit cherry-pick. If the user says agitwrite command, translate it tobutand run that. Exceptions:git add -- <path>to mark a conflicted uncommitted file resolved (see "Conflicts in uncommitted files"), and a worktree-local Git commit whenbut commitreports that linked worktrees are unsupported. Never runbut setupfrom a linked worktree. - After a mutation, read the workspace state it returned — it replaces a follow-up status command. Re-run
but status/but diffonly if that output lacks the ID you need or files changed since. - Never commit or push to a branch marked
(merged upstream); runbut pullto remove it, or create/use another branch for new work. - In non-interactive CLI workflows, do not narrate progress between routine commands. Execute the needed
butcommands and give a concise final summary. - Avoid
--helpprobes; use this skill andreferences/reference.mdfirst. Only use--helpafter a command fails or required syntax is missing from the installed references.
Command Patterns
- Commit:
but commit -b <branch> -m "<msg>" <id> <id>—-b <branch>creates the branch if it does not exist - Commit everything uncommitted:
but commit -b <branch> -m "<msg>"(omit the IDs) - Several commits from one diff: chain
but commitcalls with&&(commits stack oldest-first in the order written) - Commit at a specific history position:
--above <commit-or-branch>or--below <commit-or-branch>instead of-b - Only one targeting flag (
-b/--above/--below) per command. Targeting is required when more than one stack is applied; without itbut commitfails with "Unclear where to commit. Found more than one stack". Several branches stacked together count as one stack — an untargeted commit then silently lands on the stack's top branch, so pass-bwhenever the branch matters. - Always pass
-m "<msg>"(or--no-message) tobut commit, and tobut squashwhenever its sources are commits or branches — those compose a new message, and without a flag an editor opens and blocks. Squash sources that are uncommitted or committed files reuse the target's message and need no flag; squashing intozzrejects message flags outright. - Amend:
but amend -t <commit-or-branch> <file-or-hunk-id> <file-or-hunk-id>— a branch target resolves to its newest commit - Uncommit:
but uncommit <commit-id>(whole commit) orbut uncommit <commit-id>:<file-id>(one committed file) - Insert empty commit:
but commit --empty -b <branch> -m "<msg>" - Squash commits:
but squash <source-commit-id> [<source-commit-id>...] -t <target-commit-id> -m "<msg>" - Squash a whole branch into one commit:
but squash <branch> -m "<msg>"(no-t) - Reorder commits:
but move <commit-id> --below <commit-id>(--abovefor the other direction; commit IDs, not branch names) - Reorder a block:
but move <commit-id> <commit-id> --below <commit-id>(space-separated commit IDs) - Move commit to branch top:
but move <commit-id> -b <branch> - Stack branches:
but move <branch> --above <target-branch>(branch names or branch CLI IDs) - Tear off a branch:
but move <branch> --unstack - Discard:
but discard <id> [<id>...]— accepts branches, commits, committed files, uncommitted files/hunks, orzzfor all uncommitted changes - Push:
but push <branch-name>— always specify the branch; barebut pushpushes ALL branches when run non-interactively - Pull (update workspace from the target):
but pull— the output reports the result;--checkis only a dry-run preview - Create PR:
but pr new <branch-id> [-m "Title..."] [-F pr_message.txt] [-t] [--draft]— auto-pushes first; do not runbut pushbefore it
Task Recipes
Update workspace from main
For "get latest from main", "update/sync this workspace", "rebase onto main", or "pull main":
but pull— one command; no preflight needed. Its output reports the resulting state, it refuses safely when uncommitted changes conflict, andbut undoreverts it.- If commits come back conflicted, resolve them oldest-first following the printed instructions:
but resolve <commit>, edit the files,but resolve finish. Finishing a lower commit rebases the ones above it, so always work bottom-up.
Use but pull --check only to answer "would this conflict?" without updating (a dry-run preview), not as a step before every pull.
Rebasing applied branches onto the latest target IS but pull — never move, config target, unapply, or raw git pull/git rebase. The base shown in status is the last FETCHED state: when git log shows main (local or remote) ahead of it, that is exactly the update but pull fetches and applies — the target setting is not stale and repointing it is never the fix. Pull carries uncommitted changes along, and its output reports the resulting state. If it refuses because uncommitted changes conflict, park them: but commit -b <branch> -m "wip" <ids>, pull again, then but uncommit the parked commit (there is no stash; do not hand-revert files).
Commit selected files or hunks
but diff— shows file and hunk IDs for uncommitted changes. Do not run plainbut statusfirst.- Use file IDs when whole files belong in the commit; use hunk IDs (
<file-id>:<hunk-id>) when only part of a file belongs. Omit IDs you don't want committed. but commit -b <branch> -m "<msg>" <id1> <id2>— the branch is created if it does not exist, so no priorbut branch newis needed.- Check the returned status for remaining uncommitted changes.
Edge case: if wanted and unwanted edits are in the same diff hunk, GitButler cannot split that hunk by ID. Only when the task requires keeping part of that hunk uncommitted, temporarily edit the working tree to isolate the wanted lines, commit those IDs, then restore the leftover lines so they remain uncommitted.
Amend into existing commit
but status -fv(orbut show <branch-id>) — locate file/hunk IDs and target commit IDs.but amend -t <commit-id> <id> <id>— one command per target commit. For several target commits, chain the amends with&&when every target is a change-ID ref; otherwise run them one at a time with fresh refs from each returned status.
Split an existing commit
Use this when an existing commit should be replaced by selected smaller commits.
but status -fvwhen you need the source commit, branch name, or placement anchor.but uncommit <source-commit-id>exposes the commit's changes as uncommitted; the returned status lists the resulting file IDs. Runbut diffafter it when you need hunk IDs too.- Pick replacement contents from that dirty diff, not from the old committed diff.
- Create the replacement commits oldest-first by chaining
but commitcalls.-b <branch>puts each new commit at the TOP of that branch — if the split commit had commits above it, the replacements now sit above those preserved commits. - If a commit must stay ABOVE the replacements, put it back on top instead of fighting anchors. Do not anchor with
--above <top>/--below <top>(sha/#Nanchors go stale as each insert rewrites history). Take the preserved commit's ref from the last returned workspace state, thenbut move <preserved-commit-id> -b <branch>(several:but move <id1> <id2> -b <branch>in one command). - Leave unwanted changes uncommitted. Remember the returned state lists commits newest first: replacements created oldest-first therefore appear in reverse request order under the preserved commits — that is correct; do not reorder them. Stop when the history matches.
Reorder commits
but status displays commits newest/top first, while task specs often list history oldest to newest — translate before moving.
but statusonce to get commit IDs (use-fvonly if you also need file details).but move <source> --below <target-commit>places source immediately below target inbut status(older in oldest-to-newest history).--aboveplaces it immediately above (newer).but move <source> -b <branch>moves it to branch top/newest.- For an adjacent block, run ONE move:
but move <block-id> <block-id> --below <following-commit-id>— do not sort the whole branch or move members one by one. Source order does not matter; the block keeps its internal order. After a successful block move, stop if the returned status shows the requested order; do not move the anchor or block members again. - For other reorders, make the smallest set of moves.
Squash commits
but statusfor commit IDs and order.- Name the sources positionally and the result/target commit with
-t:but squash <source> [<source>...] -t <target> -m "<new message>". - To collapse an entire branch into one commit, pass just the branch and no
-t:but squash <branch> -m "<new message>". - Multiple independent groups may run in sequence off one status read (targets keep their change-ID refs); prefer newer/top groups first. Take fresh refs only when a ref is sha-based or
#N-suffixed. - Stop when the returned status shows the requested history; do not re-verify with extra status calls.
Stack existing branches
To make one existing branch depend on another: but move <child-branch> --above <parent-branch> (branch names or branch CLI IDs — commit reordering uses commit IDs). To unstack: but move <branch> --unstack.
DO NOT stack via uncommit + branch delete + branch new -a (git branch names persist after delete and it loses work), and do not use but undo to unstack.
Create or manage pull requests
but pr new <branch-id> pushes the branch and creates the PR in one step — no prior but push. Provide -F pr_message.txt, -t, or -m with real newlines (zsh/bash: -m $'Title\n\nBody') so no editor opens. If forge auth is missing, run but config forge auth.
For stacked branches but pr is mandatory (it sets PR bases and stack metadata; gh pr create breaks that). To publish a whole stack: but pr new <top-branch-id> -t. Manage with but pr auto-merge|set-draft|set-ready <selector>. See references/reference.md for details.
Dependency conflict with another branch
Changes that build on another branch's commits cannot land on an independent branch. but commit fails with "Couldn't commit all changes" and commits nothing — it is all-or-nothing, so no partial commit is left behind.
Recovery: stack the branches with but move <your-branch> --above <dependency-branch> (full branch names), then commit again with the same IDs. but status -fv shows which branch holds the commits the change builds on. Note the failed commit does not create its -b branch, so when the target branch was new, commit the changes onto it without the dependent IDs first (or use the dependency branch directly) — there is no branch for but move to stack until one exists.
If that but move fails, do NOT try uncommit, squash, or undo as a workaround — re-run but status -fv to confirm both branches exist and are applied, then retry with exact branch names.
Resolve conflicted commits (after pull, move, or reorder)
NEVER use git add, git commit, git checkout --theirs/--ours, or any git write command during resolution. Only but resolve commands plus direct file edits.
- Find conflicted commits: the
but pullsummary lists them oldest-first; otherwisebut statusmarks them. but resolve <commit-id>— enters resolution mode and prints the conflict regions.- Edit the files to remove every conflict marker —
<<<<<<<,|||||||(the common-ancestor section),=======and>>>>>>>— and keep the correct content. Do NOT skip this; do NOT usebut amendon conflicted commits. but resolve finish— сообщает об оставшихся маркерах и сохранившихся незакоммиченных изменениях; дополнительная проверка статуса не требуется.- Повторите для остальных конфликтующих коммитов, начиная с самого старого — завершение нижнего коммита перебазирует те, что выше него.
Конфликты в незакоммиченных файлах
but status помечает незакоммиченные файлы с неразрешёнными конфликтами слияния {conflicted}; они исключены из изменений, доступных для коммита, и находятся вне but resolve режима. Выберите нужное содержимое или удалите файл, затем git add -- <path> чтобы пометить его как разрешённый (единственная разрешённая git add).
Сопоставление Git-to-But
| git | but |
|---|---|
git status | but status для обзора ветки/стека/коммита; but status -fv для деталей файла/ханка; but diff для выбранных незакоммиченных изменений |
git add + git commit | but commit -b <branch> -m ... <ids> |
git checkout -b + commit | but commit -b <new-branch> -m ... <ids> |
git push | but push <branch-name> |
git rebase -i | but move, but squash, but reword |
git rebase --onto | but move <branch> --above <new-base> |
git checkout -- <file> / git restore | but discard <id> |
git cherry-pick | but pick |
gh pr create | but pr new <branch-id> |
Примечания
- Инспекция git только для чтения (
git log,git blame,git show --stat) разрешена. - If
butвыводитAGENT ACTION REQUIREDпредупреждение навыка, выполните предложенную команду один раз, затем перезагрузите/используйте навык GitButler. Если оно повторяется, сообщите о нём вместо повторных попыток. - Синтаксис команд и флаги:
references/reference.md - Модель рабочего пространства:
references/concepts.md - Примеры рабочих процессов:
references/examples.md
Вставить в README
Ссылка на карточку для вашего README — без картинок и счётчиков.
[DarkPlay: but](https://darkplay.ru/ai/skills/gitbutlerapp-gitbutler-but)
Из того же репозитория
Похожие скиллы и другие разделы каталога
Самые востребованные скиллов раздела по установкам и звёздам.
find-skillsvercel-labs · Помогает находить и устанавливать навыки агентов по запросам вроде «как сделать X»…
grill-memattpocock · Настойчивое интервью для доработки плана или дизайна.
hyperframesheygen-com · Обязательная точка входа для любых задач по видео, анимации и motion-графике в…
hyperframes-cliheygen-com · Цикл разработки HyperFrames CLI: init, add, render, preview, publish и другие команды.
agent-browservercel-labs · CLI для автоматизации браузера для ИИ-агентов: навигация по страницам, заполнение форм…
media-useheygen-com · Agent Media OS: единый навык для медиа в HyperFrames — BGM, SFX, изображения, голос, LUT.
hyperframes-registryheygen-com · Установка и подключение блоков реестра в композиции HyperFrames через add и catalog.
grill-with-docsmattpocock · Настойчивое интервью для доработки плана или дизайна, попутно создающее документацию (ADR…
improve-codebase-architecturemattpocock · Поиск в кодовой базе возможностей для углубления, визуальный HTML-отчёт о них и детальный…
tddmattpocock · Разработка через тестирование (TDD): red-green-refactor и интеграционные тесты.Соседние разделы каталога: возможно, нужный инструмент живёт там.
agent-deckartwist-polyakov · Управление AI-агентами через CLI agent-deck.
yandex-webmasterartwist-polyakov · Yandex Webmaster API: управление сайтами, индексация, запросы, переобход.Лучшие ИИ-инструменты для генерации видео
Подборка нейросетей для генерации и монтажа видео. Инструменты, которые превращают текст в готовые ролики, экономят часы на съемках и постпродакшне. Подходит для SMM-специалистов,
VEED.IOVeed
MootionMootion
Sora (OpenAI)OpenAI
viralpulse.appViralpulse
Viral Maker AIViral-makerЛучшие ИИ-инструменты для генерации текста и копирайтинга
Подборка нейросетей для генерации текстов и копирайтинга. Сервисы, которые помогают создавать статьи, посты и рекламные объявления с нуля или по черновику, экономя часы рутинной ра
NeuroscribeNeuroscribe
GoGPTGogpt
НейроТекстерNeuro-texter
ChatGPTOpenAI
Cosmo ScribeCosmoscribe
Memo HelperCopilot33
LibraChatLibrachatЛучшие ИИ-инструменты для генерации изображений
Подборка нейросетей для генерации изображений от фотореализма до концепт-арта. Сервисы, которые экономят часы ручной работы, создавая визуал для блогов, рекламы и дизайна за минуты
MagviMagvi
DALL-E 3OpenAI
SupaLabSupalab
Freestyling.aiFreestyling
ArtGeneration.meArtgeneration
BigjpgBigjpg
Художник от VKVK
Avato AI12ai
Virton AIVirton