Chuyển đến nội dung
Skillpedia
Lập trình chung22k · #10176

but

Skill này làm gì

Skill này cho phép agent dùng dòng lệnh GitButler để lưu, chia sẻ và xem xét các thay đổi mã. Skill dành cho lập trình viên dùng GitButler làm công cụ quản lý phiên bản.

Khi nào nên dùng

  • ✓Khi bạn muốn lưu các thay đổi đã chọn thành một commit trên nhánh mới hoặc nhánh có sẵn.
  • ✓Khi bạn cần xem diff, kiểm tra nhánh hoặc hoàn tác một bước gần đây.
  • ✓Khi bạn muốn push, pull, đồng bộ hoặc mở pull request qua GitButler.

Liên kết skill

https://github.com/gitbutlerapp/gitbutler/blob/master/crates/but/skill/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/gitbutlerapp/gitbutler/blob/master/crates/but/skill/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Chỉ commit các thay đổi trong tệp đăng nhập vào một nhánh mới tên login-fix.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent kiểm tra góc nhìn hẹp nhất nó cần, chẳng hạn các thay đổi đã chọn, rồi chạy lệnh GitButler tương ứng. Nó bỏ qua các lần kiểm tra trạng thái thừa khi kết quả đã cho thấy điều nó cần.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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 IDs, per-commit files, amend details:
but status -fv

# What one applied branch or commit changed, for review:
but diff <branch-or-commit>

# 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 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 created commit. Do not run a separate but branch new, status command, or verification diff unless the task needs workspace information that the result does not provide.

In a linked worktree, such as .claude/worktrees/*, omit -b so the commit goes on the branch the worktree has checked out. Use that branch as the new branch; do not stack another one on it. A worktree with a detached HEAD has no branch yet. There, but commit -b <new-name> -m "<msg>" creates the branch at HEAD, checks it out in that worktree, and commits to it.

IDs

The first token on each but diff / but status line is that line's ID. When a command needs an ID, copy it exactly from the current output; never hardcode or invent one. ID lifetimes differ by entity:

  • Changes and sources are positional, space-separated IDs (but commit -b feat -m "msg" uvw:2e4 uvw:e2c). An uncommitted hunk ID is written <file-id>:<hunk-id> (e.g. uvw:2e4, copied from bare but diff) — the part after the colon is the hunk's ID, not a line range (uvw:16-40 is invalid). Do not invent flags like --changes / --hunk / --ids, pass a line range, or comma-separate IDs — uvw,qyo is parsed as one ID and fails.
  • but diff is the exception: it accepts at most one target. Bare but diff shows all uncommitted files; inspect committed files or other entities one target at a time — never but diff <id> <id>.
  • A committed file is <commit-id>:<file-id> (e.g. mzm:uvw, shown under each commit). A committed hunk is <commit-id>:<file-id>:<hunk-id> and is shown by but diff <commit-id>. @ means 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.
  • Branch short IDs are snapshot-local selectors. Use full branch names for branch-targeting mutations; short IDs are safe only for immediate read-only inspection.
  • File/hunk IDs copied from one diff read generally remain usable across chained commits. If one stops resolving, re-read but diff and retry.

Chaining: mutation output is concise by default, so you may chain mutations with && off one inspection read. Do not chain branch short IDs through mutations; use full branch names. Add --status-after only when the next step needs workspace IDs or details that the mutation result does not provide. 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 with --status-after when a ref is sha-based or #N-suffixed, or when the next command needs freshly issued IDs. Chaining but uncommit <id> && but diff is safe because bare diff needs no ID from the uncommit output. Never pipe a mutation through tail or head: the pipeline then exits with their status, so the next && runs even when the mutation failed.

Non-Negotiable Rules

  1. Use but for all write operations. Never run git add, git commit, git push, git fetch, git pull, git checkout, git merge, git rebase, git stash, or git cherry-pick; but pull --check fetches. The only exceptions are selecting a side of a conflicted submodule in resolution mode (see Resolve conflicted commits) and creating a missing target branch (see No
Câu hỏi thường gặp

Tôi có cần biết lệnh Git không?

Không cần cho các tác vụ này. Skill dùng dòng lệnh riêng của GitButler.

Nó có thể commit chỉ một số tệp không?

Có. Nó có thể commit các tệp đã chọn hoặc một phần của tệp, dùng ID hiển thị trong diff.

Điều gì xảy ra trong một worktree liên kết?

Nó commit lên nhánh đang được checkout trong worktree đó, thay vì xếp chồng một nhánh mới lên trên.

Chi tiết

Mô tả gốc của tác giả

Commit, push, branch, and manage version control with GitButler. Use for commits, selective dirty-file or hunk commits, branches, diffs, PRs, history edits, squashes, amends, undo, merge, fetching, pulling and syncing a branch with its remote, apply, unapply, and linked worktrees. For selected dirty files or hunks, inspect with `but diff`; use compact `but status` for commit order, branch/stack placement, or conflict overview; use `but status -fv` when file IDs or per-commit file details matter. Replaces git write commands, including fetch and pull. Applies in every checkout of the repository,

repo: gitbutlerapp/gitbutler

Độ phổ biến

Sao GitHub
22k
Vị trí xếp hạng
#10176
Giấy phép
—
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự