but
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGitButler CLI Skill
GitButler CLI Skill
Use GitButler CLI () as the default version-control interface.
but将GitButler CLI()作为默认的版本控制界面。
butNon-Negotiable Rules
不可违反的规则
- Use for all write operations. Never run
but,git add,git commit,git push,git checkout,git merge,git rebase, orgit stash.git cherry-pick - Start every write/history-edit task with .
but status --json - For mutation commands, always add .
--json --status-after - Use CLI IDs from /
but status --json/but diff --json; do not hardcode IDs and do not switch branches withbut show --json.git checkout - After a successful mutation with , do not run a redundant
--status-afterunless needed for new IDs.but status - If the user says a write command (for example "git push"), translate it to the
gitequivalent and execute thebutcommand directly.but - For branch-update tasks, run before
but pull --check --json. Do not substitutebut pull --json --status-after+ status summaries for this check.but fetch - Avoid routine probes before mutations. Use the command patterns in this skill (and
--help) first; only usereferences/reference.mdwhen syntax is genuinely unclear or after a failed attempt.--help
- 所有写入操作均使用命令。禁止运行
but、git add、git commit、git push、git checkout、git merge、git rebase或git stash命令。git cherry-pick - 所有写入/编辑历史的任务均以开头。
but status --json - 执行变更类命令时,务必添加参数。
--json --status-after - 使用/
but status --json/but diff --json返回的CLI ID;请勿硬编码ID,也不要使用but show --json切换分支。git checkout - 使用参数成功执行变更操作后,除非需要获取新ID,否则请勿重复运行
--status-after。but status - 如果用户提及某个Git写入命令(例如"git push"),将其转换为对应的命令并直接执行。
but - 执行分支更新任务时,先运行,再运行
but pull --check --json。请勿用but pull --json --status-after+ 状态摘要替代此检查步骤。but fetch - 执行变更操作前,避免常规性地使用查询。优先使用本技能中的命令模式(及
--help);仅当语法确实不明确或尝试失败后,才使用references/reference.md。--help
Core Flow
核心流程
bash
but status --jsonbash
but status --jsonIf new branch needed:
如果需要创建新分支:
but branch new <name>
but branch new <name>
Perform task with IDs from status/diff/show
使用status/diff/show返回的ID执行任务
but <mutation> ... --json --status-after
undefinedbut <mutation> ... --json --status-after
undefinedCanonical Command Patterns
标准命令范式
- Commit specific files/hunks:
but commit <branch> -m "<message>" --changes <id>,<id> --json --status-after - Create branch while committing:
but commit <branch> -c -m "<message>" --changes <id> --json --status-after - Amend into a known commit:
but amend <file-id> <commit-id> --json --status-after - Reorder commits:
but move <source-commit-id> <target-commit-id> --json --status-after - Push:
or
but pushbut push <branch-id> - Pull update safety flow:
then
but pull --check --jsonbut pull --json --status-after
- 提交特定文件/代码块:
but commit <branch> -m "<message>" --changes <id>,<id> --json --status-after - 提交时创建分支:
but commit <branch> -c -m "<message>" --changes <id> --json --status-after - 修改已有提交:
but amend <file-id> <commit-id> --json --status-after - 调整提交顺序:
but move <source-commit-id> <target-commit-id> --json --status-after - 推送:
或
but pushbut push <branch-id> - 拉取更新的安全流程:
然后
but pull --check --jsonbut pull --json --status-after
Task Recipes
任务操作指南
Commit one file
提交单个文件
but status --json- Find that file's
cliId but commit <branch> -c -m "<clear message>" --changes <file-id> --json --status-after
but status --json- 找到该文件的
cliId but commit <branch> -c -m "<清晰的提交信息>" --changes <file-id> --json --status-after
Commit only A, not B
仅提交A,不提交B
but status --json- Find ID and
src/a.rsIDsrc/b.rs - Commit with only
--changes <a-id>
but status --json- 找到的ID和
src/a.rs的IDsrc/b.rs - 仅使用参数执行提交
--changes <a-id>
User says "git push"
用户说“git push”
Interpret as GitButler push. Run (or ) immediately.
Do not run , even if reports nothing to push.
but pushbut push <branch-id>git pushbut push将其理解为GitButler的推送命令。直接运行(或)。即使提示没有内容可推送,也不要运行。
but pushbut push <branch-id>but pushgit pushCheck mergeability, then update branches
检查合并可行性,然后更新分支
- Run exactly:
but pull --check --json - If user asked to proceed, run:
but pull --json --status-after - Do not replace step 1 with ,
but fetch, or a narrative-only summary.but status
- 严格运行:
but pull --check --json - 如果用户确认继续,运行:
but pull --json --status-after - 请勿用、
but fetch或仅文字摘要替代步骤1。but status
Amend into existing commit
修改已有提交
but status --json- Locate file ID and commit ID from (or
status)but show <branch-id> --json - Run exactly:
but amend <file-id> <commit-id> --json --status-after - Never use or
git checkoutgit commit --amend
but status --json- 从(或
status)中找到文件ID和提交IDbut show <branch-id> --json - 严格运行:
but amend <file-id> <commit-id> --json --status-after - 绝对不要使用或
git checkoutgit commit --amend
Reorder commits
调整提交顺序
but status --json- Identify source/target commit IDs in the branch by commit message
- Run:
but move <commit-a> <commit-b> --json --status-after - From the returned , refresh IDs and then run the inverse move:
statusbut move <commit-b> <commit-a> --json --status-after - This two-step sequence is the safe default for reorder requests.
- Never use for this.
git rebase
but status --json- 根据提交信息在分支中识别源提交ID和目标提交ID
- 运行:
but move <commit-a> <commit-b> --json --status-after - 从返回的中刷新ID,然后运行反向调整命令:
statusbut move <commit-b> <commit-a> --json --status-after - 这种两步操作是调整提交顺序的安全默认方式。
- 绝对不要使用完成此操作。
git rebase
Git-to-But Map
Git与But命令映射表
- ->
git statusbut status --json - +
git add->git commitbut commit ... --changes ... --json --status-after - ->
git checkout -bbut branch new <name> - ->
git pushbut push - ->
git rebase -i,but move,but squashbut reword - ->
git cherry-pickbut pick
- ->
git statusbut status --json - +
git add->git commitbut commit ... --changes ... --json --status-after - ->
git checkout -bbut branch new <name> - ->
git pushbut push - ->
git rebase -i,but move,but squashbut reword - ->
git cherry-pickbut pick
Notes
注意事项
- Prefer explicit IDs over file paths for mutations.
- is the safe default for precise commits.
--changes - accepts one argument per flag. For multiple IDs, use comma-separated values (
--changes) or repeat the flag (--changes a1,b2), not--changes a1 --changes b2.--changes a1 b2 - Read-only git inspection is allowed (,
git log) when needed.git blame - Keep skill version checks low-noise:
- Do not run as a routine preflight on every task.
but skill check - Run when command behavior appears to diverge from this skill (for example: unexpected unknown-flag errors, missing subcommands, or output shape mismatches), or when the user asks.
but skill check - If update is available, recommend (or run it if the user asked to update).
but skill check --update
- Do not run
- For deeper command syntax and flags, use .
references/reference.md - For workspace model and dependency behavior, use .
references/concepts.md - For end-to-end workflow patterns, use .
references/examples.md
- 执行变更操作时,优先使用明确的ID而非文件路径。
- 是精准提交的安全默认参数。
--changes - 每个参数仅接受一个值。若要传入多个ID,可使用逗号分隔(
--changes)或重复该参数(--changes a1,b2),请勿使用--changes a1 --changes b2格式。--changes a1 b2 - 必要时可使用只读的Git检查命令(、
git log)。git blame - 降低技能版本检查的干扰:
- 不要在每个任务开始时例行运行。
but skill check - 当命令行为与本技能描述不符时(例如:出现意外的未知参数错误、缺少子命令或输出格式不匹配),或用户要求时,才运行。
but skill check - 如果有可用更新,建议运行(或在用户要求时直接运行)。
but skill check --update
- 不要在每个任务开始时例行运行
- 如需了解更详细的命令语法和参数,请参阅。
references/reference.md - 如需了解工作区模型和依赖行为,请参阅。
references/concepts.md - 如需了解端到端工作流模式,请参阅。
references/examples.md