跳到正文
cccskills
免费在 GitHub 公开

git-cleanup

Clean up local Git branches and remote connections left after pull request reviews. The workflow checks unfinished work, preserves main and the current branch, and requests confirmation before force-deleting branches that have not been merged.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

Clean up local git branches and remotes accumulated from PR reviews. Use when the user asks to clean branches, remove stale remotes, or tidy up the local git state.

查看安装方法

适用场景

  • Clean up branches after pull request reviews
  • Remove contributor remotes other than origin
  • Review unmerged branches before deletion
  • Check unfinished work before Git cleanup

包含的文件(1)

  • SKILL.md1.4 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Git Cleanup

Clean local branches (except main and current branch) and non-origin remotes. Useful after reviewing multiple PRs that leave behind tracking branches and contributor remotes.

Workflow

1. Survey

Run these in parallel:

git branch
git remote
git status --short
git stash list

Present a summary of how many branches and remotes will be removed.

2. Safety Checks — Ask Before Proceeding

Stop and ask for confirmation if any of these are true:

  • Current branch is NOT main
  • Working tree has uncommitted changes or stashes
  • Any branch is ahead of its upstream

List unmerged branches separately and let the user decide.

3. Delete Branches

# Safe delete first (fails on unmerged branches)
git branch | grep -v '^\*' | grep -v '^\s*main$' | xargs git branch -d 2>&1

# Force-delete only with explicit user approval
git branch -D <branch>

4. Remove Remotes

git remote | grep -v '^origin$' | xargs -I{} git remote remove {}

5. Confirm

git branch && echo "---" && git remote

Report what was cleaned up.

Key Rules

  • NEVER delete main or the current checked-out branch
  • NEVER force-delete unmerged branches without user confirmation
  • If in doubt, ask

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Maintain an application's supported language models by checking provider availability, adding models, and keeping documentation, live tests, and model-specific request settings aligned. It also checks provider model identifiers and candidates for the recommended list.

中文简介正在准备中。当前显示英语简介。

  • Add support for a specific language model
  • Check whether listed models are still available
  • Update provider model identifiers
alibaba/page-agent2.9万2026年10月18日 更新

Evaluate a proposed software change before implementation. It examines project files and official sources, compares options and trade-offs, and builds a concrete plan covering affected systems, effort, risks, and unresolved questions for the user's approval.

中文简介正在准备中。当前显示英语简介。

  • Discuss a major change before implementation
  • Compare migration or configuration options
  • Estimate affected files and implementation effort
alibaba/page-agent2.9万2026年10月18日 更新

Submit existing local changes as a pull request by reviewing the diff, running project checks, preparing a branch and commit, and pushing to GitHub. It follows contribution rules and preserves template declarations that require human verification.

中文简介正在准备中。当前显示英语简介。

  • Submit current local changes as a pull request
  • Prepare a branch and commit following project conventions
  • Run project checks before submission
alibaba/page-agent2.9万2026年10月18日 更新

Update a project's changelog using GitHub releases, git history, and code differences. Select changes that matter to users, match the existing format, and write concise entries for the requested release.

中文简介正在准备中。当前显示英语简介。

  • Add the latest missing release entry
  • Align changelog text with GitHub Releases
  • Summarize changes between release tags
alibaba/page-agent2.9万2026年10月18日 更新

查看 alibaba 的全部技能

报告此技能的问题