manage-git-branches
정보
이 Claude Skill은 개발자들이 기능, 수정, 정리 작업을 위한 Git 브랜치를 관리하도록 돕습니다. 상류 저장소와 동기화하고 병합된 브랜치를 안전하게 정리하는 작업을 포함하여, 브랜치 생성, 전환, stash 같은 안전한 방법을 사용합니다. 새로운 작업을 시작하거나 작업을 전환할 때, 혹은 메인 브랜치와 최신 상태를 유지할 때 사용하세요.
빠른 설치
Claude Code
추천npx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/manage-git-branchesClaude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요
문서
Manage Git Branches
Create, switch, sync, clean up branches per consistent naming.
Use When
- Start new feature / bug fix
- Switching tasks on diff branches
- Keep feature branch up-to-date w/ main
- Clean up after merging PRs
- List + inspect branches
In
- Req: Repo w/ ≥1 commit
- Opt: Naming convention (default:
type/description) - Opt: Base branch (default:
main) - Opt: Remote name (default:
origin)
Do
Step 1: Create Feature Branch
Consistent naming:
| Prefix | Purpose | Example |
|---|---|---|
feature/ | New functionality | feature/add-weighted-mean |
fix/ | Bug fix | fix/null-pointer-in-parser |
docs/ | Documentation | docs/update-api-reference |
refactor/ | Code restructuring | refactor/extract-validation |
chore/ | Maintenance | chore/update-dependencies |
test/ | Test additions | test/add-edge-case-coverage |
# Create and switch to a new branch from main
git checkout -b feature/add-weighted-mean main
# Or using the newer switch command
git switch -c feature/add-weighted-mean main
→ New branch created + checked out. git branch shows branch w/ asterisk.
If err: Base branch doesn't exist locally → fetch first: git fetch origin main && git checkout -b feature/name origin/main.
Step 2: Track Remote Branches
Setup tracking when pushing new branch first time:
# Push and set upstream tracking
git push -u origin feature/add-weighted-mean
# Check tracking relationship
git branch -vv
Check out remote branch someone else created:
git fetch origin
git checkout feature/their-branch
# Git auto-creates a local tracking branch
→ Local tracks remote. git branch -vv shows upstream.
If err: Auto-tracking fails → manually: git branch --set-upstream-to=origin/feature/name feature/name.
Step 3: Switch Branches Safely
Before switch → working tree clean:
# Check for uncommitted changes
git status
Changes exist → commit or stash:
# Option 1: Commit work in progress
git add <files>
git commit -m "wip: save progress on validation logic"
# Option 2: Stash changes temporarily
git stash push -m "validation work in progress"
# Switch branches
git checkout main
# Later, restore stashed changes
git checkout feature/add-weighted-mean
git stash pop
List + manage stashes:
# List all stashes
git stash list
# Apply a specific stash (without removing it)
git stash apply stash@{1}
# Drop a stash
git stash drop stash@{0}
→ Switch succeeds. Working tree reflects target. Stashed changes recoverable.
If err: Switch blocked by uncommitted changes → stash or commit first. git stash can't stash untracked files unless git stash push -u.
Step 4: Sync w/ Upstream
Keep feature branch up-to-date w/ base:
# Fetch latest changes
git fetch origin
# Rebase onto latest main (preferred — keeps linear history)
git rebase origin/main
# Or merge main into your branch (creates merge commit)
git merge origin/main
→ Branch has latest from main. No conflicts, or resolved (see resolve-git-conflicts).
If err: Rebase conflicts → resolve each + git rebase --continue. Too complex → abort w/ git rebase --abort + try git merge origin/main.
Step 5: Clean Up Merged Branches
After PRs merged → remove stale:
# Delete a local branch that has been merged
git branch -d feature/add-weighted-mean
# Delete a local branch (force, even if not merged)
git branch -D feature/abandoned-experiment
# Delete a remote branch
git push origin --delete feature/add-weighted-mean
# Prune remote-tracking references for deleted remote branches
git fetch --prune
→ Merged branches removed locally + remotely. git branch shows only active.
If err: git branch -d refuses unmerged. If merged via squash merge on GitHub → Git may not recognize as merged. Use git branch -D if certain work preserved.
Step 6: List + Inspect
# List local branches
git branch
# List all branches (local and remote)
git branch -a
# List branches with last commit info
git branch -v
# List branches merged into main
git branch --merged main
# List branches NOT yet merged
git branch --no-merged main
# See which remote branch each local branch tracks
git branch -vv
→ Clear view of all branches, status, tracking.
If err: Remote branches appear stale → git fetch --prune → clean up refs to deleted remotes.
Check
- Branch names follow agreed convention
- Feature branches from correct base
- Local branches track remotes
- Merged cleaned up (local + remote)
- Working tree clean before switches
- Stashes not left orphaned
Traps
- Work on main directly: Always create feature branch. Committing directly to main → hard to create PRs + collaborate.
- Forget fetch before branching: Creating from stale local main → start behind. Always
git fetch originfirst. - Long-lived branches: Weeks-long → accumulate conflicts. Sync freq + keep short-lived.
- Orphaned stashes:
git stash= temporary storage. Don't rely for long-term. Commit / branch instead. - Delete unmerged work:
git branch -Ddestructive. Double-check w/git log branch-namebefore force-delete. - Not pruning: Remote branches deleted on GitHub still appear locally until
git fetch --prune.
→
commit-changes— committing work on branchescreate-pull-request— opening PRs from feature branchesresolve-git-conflicts— handling conflicts during syncconfigure-git-repository— repo setup + branch strategy
GitHub 저장소
연관 스킬
content-collections
메타이 스킬은 콘텐츠 콜렉션(Content Collections)을 위한 프로덕션 검증된 설정을 제공합니다. 콘텐츠 콜렉션은 Markdown/MDX 파일을 Zod 검증이 포함된 타입 안전한 데이터 콜렉션으로 변환해주는 TypeScript 최우선 도구입니다. 블로그, 문서 사이트 또는 콘텐츠 중심의 Vite + React 애플리케이션을 구축할 때 타입 안전성과 자동 콘텐츠 검증을 보장하기 위해 사용하세요. Vite 플러그인 구성과 MDX 컴파일부터 배포 최적화 및 스키마 검증에 이르기까지 모든 것을 다룹니다.
polymarket
메타이 스킬은 개발자들이 Polymarket 예측 시장 플랫폼을 활용한 애플리케이션을 구축할 수 있도록 지원하며, 거래 및 시장 데이터를 위한 API 통합 기능을 포함합니다. 또한 WebSocket을 통한 실시간 데이터 스트리밍을 제공하여 실시간 거래와 시장 활동을 모니터링할 수 있습니다. 이를 통해 거래 전략을 구현하거나 실시간 시장 업데이트를 처리하는 도구를 생성하는 데 활용할 수 있습니다.
creating-opencode-plugins
메타이 스킬은 개발자들이 명령어, 파일, LSP 작업 등 25개 이상의 이벤트 유형에 연결되는 OpenCode 플러그인을 만들 수 있도록 돕습니다. JavaScript/TypeScript 모듈을 위한 플러그인 구조, 이벤트 API 명세, 구현 패턴을 제공합니다. OpenCode AI 어시스턴트의 라이프사이클을 사용자 정의 이벤트 기반 로직으로 가로채거나, 모니터링하거나, 확장해야 할 때 사용하세요.
sglang
메타SGLang은 RadixAttention 프리픽스 캐싱을 활용하여 JSON, 정규식, 에이전트 워크플로우를 위한 고속 구조화 생성에 특화된 고성능 LLM 서빙 프레임워크입니다. 특히 반복되는 프리픽스가 있는 작업에서 상당히 빠른 추론 속도를 제공하여 복잡한 구조화 출력 및 다중 턴 대화에 이상적입니다. 제약 디코딩이 필요하거나 광범위한 프리픽스 공유가 있는 애플리케이션을 구축할 때는 vLLM과 같은 대안보다 SGLang을 선택하십시오.
