Skip to content
Agentmart
Submit a tool

git-prefs

git 操作偏好:可审计提交、rebase 同步远程、删除当前工作树(清空内容、保留目录壳)。提交、同步、用户要求删除当前工作树时使用;删除仅限用户明确要求。

Skill by gitbobobo

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/gitbobobo-git-prefs

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

git 操作偏好:可审计提交、rebase 同步远程、删除当前工作树(清空内容、保留目录壳)。提交、同步、用户要求删除当前工作树时使用;删除仅限用户明确要求。

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Node.js package

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/git-prefs

What's inside

Skill name
git-prefs
Description
git 操作偏好:可审计提交、rebase 同步远程、删除当前工作树(清空内容、保留目录壳)。提交、同步、用户要求删除当前工作树时使用;删除仅限用户明确要求。
License
MIT
Instructions
34 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts

Files (3)

  • SKILL.md
  • empty-worktree.mjs · scripts/
  • empty-worktree.test.mjs · scripts/

SKILL.md (first lines)

# git-prefs

## 提交

要求:

- 按可审计粒度提交,提交信息清晰、满足 Conventional Commits,且只提交应入库文件
- 核验修改内容相关的最小检查。已有证据与当前源码(含脏改动)、工具链及检查范围一致时,可读原始日志/报告、确认命令和退出码后采用;源码变化、证据不完整或覆盖有缺口时补跑对应检查。失败先修复,再完成提交
- 改动涉及 `skills/` 或 `README.md` 时(gitbobobo/skills 仓库),提交前确认 `node scripts/check.mjs` 在当前内容上通过;同源码的已有证据按上条核验采用

流程:

1. 先检查 `git status --porcelain` 再决策。
2. 若发现应忽略文件/临时文件:征求用户意见后决定 1 纳入提交 2 保留并更新 `.gitignore` 3 直接删除。
3. 按「提交要求」完成提交,结束时应尽量保证工作区干净。

## 同步

- 同步在用户要求时或首次推送前执行;已开 PR 的分支见 `$pr-review-loop`「不追目标分支」
- 同步前确保工作区干净:先检查 `git status --porcelain`,若有未提交变更先按「提交」完成,再同步,避免 rebase / merge 时产生冲突或丢失改动
- 尚未推送的分支优先通过 rebase 保持线性历史
- 禁止直接丢弃提交内容,必须根据提交时间理解修改意图
- 冲突需先理解双方修改意图再解决,必要时征求用户意见

## 删除当前工作树(仅限用户明确要求)

「删除工作树」默认指当前所在的工作树:运行 `node <技能目录>/scripts/empty-worktree.mjs`(`--dry-run` 预演)。脚本清空当前链接工作树的全部内容(含 `.git`),保留目录壳并写入 `.worktree-placeholder`——目录留着,绑定它的终端 cwd 继续有效;随后在主仓库 `worktree prune` 注销注册。

- 绝不删除工作树目录本身(`rm -rf` 整树、`git worktree remove` 自己所在的树):绑定该目录的终端在命令运行前即失败,永久失效,`cd` 救不回来
- cwd 必须是工作树根;在子目录时先 `cd` 到根再跑,否则清空会把终端 cwd 一起抹掉(脚本同样拒绝)
- 主检出(非链接工作树)一律拒绝执行,这是防呆底线
- 清空后该目录不再是 git 仓库,后续 `git` 命令失败是预期;空壳与本地分支留给后续清理

From gitbobobo/skills, MIT.

More from gitbobobo/skills

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Oct 19, 2026 (9 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from gitbobobo

Cite this page

git-prefs skill. Agent Mart. https://agentmart.dev/skills/gitbobobo-git-prefs (last updated 2026-10-24)