管理 Git 分支可能令人困惑,尤其是在處理錯誤或同步問題時。此技能可自動化分支調查與建立,並處理常見問題,例如衝突與未提交變更。
下载技能 ZIP
在 Claude 中上传
前往 设置 → 功能 → 技能 → 上传技能
开启并开始使用
测试它
正在使用“managing-branches”。 Check the current branch status
预期结果:
- Current branch: feature/new-api
- Uncommitted changes: 3 files modified
- Remote sync: 2 commits ahead of main
- Remote branches: origin/main is up to date
- Recommended action: Consider committing or stashing changes before continuing
正在使用“managing-branches”。 Create a feature branch from main
预期结果:
- Fetching latest changes from origin main
- Creating new branch feature/user-auth from main
- Branch created successfully
- Switched to new branch feature/user-auth
- No conflicts detected during creation
安全审计
安全This is a prompt-based Git utility skill with no malicious code. The static scanner incorrectly flagged multiple findings: the 'weak cryptographic algorithm' detections are false positives (the scanner misidentified strings like 'managing-branches' and 'Quick branch status check' as crypto references). The 'external_commands' findings show standard Git commands (git branch, git status, git checkout) that are safe for a branch management skill. The 'filesystem' and 'network' findings are metadata strings, not actual access calls. The skill only uses safe Git commands and does not perform destructive operations.
风险因素
⚙️ 外部命令 (1)
质量评分
你能构建什么
快速分支狀態檢查
取得目前分支、未提交變更與同步狀態的摘要
分支建立流程
依命名規範建立功能分支,並包含錯誤處理
Git 學習輔助
透過引導式錯誤解決步驟學習 git 分支操作
试试这些提示
Check the current branch status. Show me the current branch, any uncommitted changes, and how up-to-date it is with the main branch.
Create a new branch called feature/my-feature-name from the main branch. Make sure the main branch is up to date first.
I got an error when trying to work with branches. Help me resolve it. The error was: [describe error]
Help me resolve merge conflicts in my current branch. First show me what files have conflicts, then guide me through resolving them.
最佳实践
- 建立或更新分支前,務必先從遠端抓取
- 切換分支前先暫存或提交未提交的變更
- 確認分支命名規範符合團隊標準
避免
- 建立名稱包含空白或特殊字元的分支
- 未經團隊同意對共用分支強制推送
- 忽略合併衝突並將其留置未解
常见问题
這個技能可以在 GitHub、GitLab 和 Bitbucket 上使用嗎?
如果我嘗試建立已存在的分支會發生什麼?
我可以用它搭配 GitHub CLI 建立 pull requests 嗎?
使用這個技能我的儲存庫資料安全嗎?
如果我遇到複雜的合併衝突怎麼辦?
這和 Git aliases 有什麼不同?
开发者详情
文件结构
📄 SKILL.md