Loading...
Loading...
Compare original and translation side by side
butbutgit branch --show-currentgitbutler/workspacebutbutPrefer | Use | Use |
|---|---|---|
| | |
| | |
| | |
| | |
| | |
butbutbut undoundefinedgit branch --show-currentgitbutler/workspacebutbut优先使用 | 可自由使用 | 谨慎使用 |
|---|---|---|
| | |
| | |
| | |
| | |
| | |
butbutbut undoundefined
---
---| Feature | Git | GitButler |
|---|---|---|
| Undo operations | Complex reflog | |
| Time travel | Risky reset | |
| Squash commits | | |
| Fix old commit | stash → rebase → amend | |
| Multiple features | Switch branches constantly | Virtual branches (simultaneous) |
| 功能特性 | Git | GitButler |
|---|---|---|
| 撤销操作 | 复杂的reflog | |
| 时光回溯 | 高风险的reset操作 | |
| 压缩提交 | | |
| 修改旧提交 | stash → rebase → amend | |
| 多特性并行开发 | 频繁切换分支 | 虚拟分支(可同时进行) |
but status # View workspace state (branches, commits, changes)
but oplog # View operation history (time-travel checkpoints)╭┄00 [Unassigned Changes]
┊ g0 M calculator.py [LOCKED] 8ebedce ← File ID, status, dependency
┊
┊╭┄al [calculator-feature] ← Branch ID
┊● abc1234 Commit message ← Commit
├╯
┊
┴ 6e7da9e (common base) [origin/main]g0h0but rubalut[LOCKED] <sha>MADbut status # 查看工作区状态(分支、提交、变更)
but oplog # 查看操作历史(时光回溯检查点)╭┄00 [未分配变更]
┊ g0 M calculator.py [LOCKED] 8ebedce ← 文件ID、状态、依赖提交
┊
┊╭┄al [calculator-feature] ← 分支ID
┊● abc1234 提交信息 ← 提交记录
├╯
┊
┴ 6e7da9e (公共基线) [origin/main]g0h0but rubalut[LOCKED] <sha>MADrubrubrub| Source | Target | Operation | Example |
|---|---|---|---|
| File | Branch | Assign | |
| File | Commit | Amend | |
| Commit | Commit | Squash | |
| Commit | Branch | Move | |
but status # Get current SHAs
but rub <source-sha> <target-sha> # Squash source INTO target
but reword <new-sha> -m "Combined message" # Update messagerub| 源类型 | 目标类型 | 操作 | 示例 |
|---|---|---|---|
| 文件 | 分支 | 分配 | |
| 文件 | 提交 | 修改 | |
| 提交 | 提交 | 压缩 | |
| 提交 | 分支 | 移动 | |
but status # 获取当前提交SHA
but rub <源SHA> <目标SHA> # 将源提交压缩到目标提交中
but reword <新SHA> -m "合并后的提交信息" # 更新提交信息absorbabsorbundefinedundefined
GitButler automatically:
1. Analyzes which lines changed
2. Finds the commit that introduced them
3. Amends the change into that commit
4. Rebases all dependent commits
---
GitButler会自动执行以下操作:
1. 分析哪些代码行被修改
2. 找到引入这些代码行的提交
3. 将修改合并到该提交中
4. 对所有依赖提交执行变基操作
---but reword <sha> -m "new message" # Edit commit message (auto-rebases)
but absorb # Auto-amend changes to correct commits
but absorb <file-id> # Absorb specific file onlybut reword <sha> -m "新的提交信息" # 编辑提交信息(自动执行变基)
but absorb # 自动将变更合并到对应提交
but absorb <文件ID> # 仅合并指定文件的变更but undo # Undo last operation (one step back)
but oplog snapshot -m "checkpoint" # Create named checkpoint
but restore <sha> --force # Restore to any oplog snapshotbut oplog # See all operationsbut undo # 撤销上一次操作(回退一步)
but oplog snapshot -m "检查点" # 创建命名检查点
but restore <sha> --force # 恢复到任意oplog快照状态but oplog # 查看所有操作记录
Even undos are tracked! You can undo an undo.
---
即使是撤销操作也会被记录!你可以撤销之前的撤销操作。
---but branch new <name> # Create virtual branch
but branch list # List all branches
but branch unapply <id> # Hide branch temporarily
but branch apply <id> # Show branch againundefinedbut branch new <名称> # 创建虚拟分支
but branch list # 列出所有分支
but branch unapply <ID> # 临时隐藏分支
but branch apply <ID> # 重新显示分支undefined
**No context switching!** Both branches are active simultaneously.
---
**无需切换上下文!** 两个分支可同时处于激活状态。
---but commit <branch> -m "message" # Commit ALL uncommitted changes
but commit <branch> -m "message" --only # Commit ONLY assigned changes
but commit -c -m "message" # Create new branch and commit--onlybut commitbut commit <分支> -m "提交信息" # 提交所有未提交的变更
but commit <分支> -m "提交信息" --only # 仅提交已分配的变更
but commit -c -m "提交信息" # 创建新分支并提交--onlybut commit| Git Command | But Command |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| N/A | |
| N/A | |
| N/A | |
| Git命令 | But命令 |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| 无对应命令 | |
| 无对应命令 | |
| 无对应命令 | |
but status # Find the commit SHA
but reword <sha> -m "Fixed message"but status # 找到目标提交的SHA
but reword <SHA> -m "修正后的提交信息"but status # Get SHAs
but rub <source> <target> # Squash
but reword <new-sha> -m "Combined" # Update messagebut status # 获取所有相关提交的SHA
but rub <源SHA> <目标SHA> # 压缩提交
but reword <新SHA> -m "合并后的提交信息" # 更新提交信息undefinedundefinedundefinedundefinedbut undo # Quick: undo last operationbut undo # 快速撤销上一次操作
---
---| Error | Cause | Recovery |
|---|---|---|
| GitButler not initialized | Run |
| "Branch not found" | Virtual branch deleted/renamed | Run |
| "Conflict detected" | Merge conflict during operation | Resolve conflicts in files, then |
| "Uncommitted changes" | Operation blocked by dirty state | Commit or stash changes first |
| Command hangs | Large repo or network issue | Wait, or Ctrl+C and retry |
| 错误信息 | 原因 | 恢复方法 |
|---|---|---|
| GitButler未初始化 | 运行 |
| "分支未找到" | 虚拟分支已被删除/重命名 | 运行 |
| "检测到冲突" | 操作过程中出现合并冲突 | 手动解决文件中的冲突,然后执行 |
| "存在未提交的变更" | 操作因工作区未清理而被阻止 | 先提交或暂存变更 |
| 命令执行卡住 | 仓库过大或网络问题 | 等待一段时间,或按Ctrl+C后重试 |
but undo # Undo last operation (safe, always works)
but oplog # View all operations for recovery points
but restore <sha> --force # Restore to any previous state
but oplog snapshot list # List named checkpointsbut undo # 撤销上一次操作(安全,始终可用)
but oplog # 查看所有操作记录以找到恢复点
but restore <sha> --force # 恢复到任意之前的状态
but oplog snapshot list # 列出所有命名检查点undorestoreundorestorebut undobut restorebut undobut restorebut claude pre-toolbut claude post-toolbut claude stopbut commitreferences/hooks.mdbut claude pre-toolbut claude post-toolbut claude stopbut commitreferences/hooks.mdreferences/cheatsheet.mdreferences/tutorial.mdreferences/hooks.mdreferences/cheatsheet.mdreferences/tutorial.mdreferences/hooks.md