- Home
- Skills
- 0xbigboss
- Claude Code
- Git Best Practices
git-best-practices_skill
- TypeScript
36
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill 0xbigboss/claude-code --skill git-best-practices- SKILL.md8.8 KB
Overview
This skill codifies Git workflow patterns for commits, branching, pull requests, and safe history rewriting across heterogeneous repositories. It provides guarded, repeatable steps for discovering branches, creating conventional commits, staging explicitly, and pushing changes while protecting shared history. Use it to produce reviewable PRs and maintain clean repository history.
How this skill works
The skill inspects repository state (git status, git diff HEAD) and discovers branch topology (default, current, production) before any branching or PR work. It guides explicit staging, composes conventional commits (type(scope): description), and enforces safe push rules (regular push by default, --force-with-lease only after confirmation). For messy WIP history it supports a rewrite flow that backups the branch, recreates a clean commit narrative, and asks for user confirmation before force-pushing.
When to use it
- Creating commits that should follow conventional commit format
- Starting new branches or determining correct PR targets
- Opening pull requests and preparing PR descriptions and test plans
- Rewriting branch history to create a clean narrative before a PR
- Any push that might rewrite upstream history (ensure confirmation)
Best practices
- Discover default/current/production branches before branching or opening PRs
- Stage files explicitly by name and verify staged content with git status
- Write commits as type(scope): description; add a body only for non-obvious rationale
- Use git push --force-with-lease for rewritten history and always confirm with the user
- Keep secrets and large binaries out of commits; warn if sensitive files are staged
Example use cases
- Prepare a feature branch: discover default branch, create feat/ branch, stage files, and commit with feat(scope): summary
- Clean up WIP work before review: run rewrite-history flow, create a tidy sequence of commits, then force-push with --force-with-lease after confirmation
- Open a PR with a concise title, 1–3 bullet summary, and a bulleted test plan checklist
- Perform a hotfix: branch off production, apply fix, use squash merge policy for a single atomic change
FAQ
Add a body only when the why or tradeoffs are non-obvious, when multiple parts need explanation, or when external context/links are required.
What if the repository documents a different branch policy?
Always follow the repository's documented policy first. Use these defaults only when no repo-specific guidance exists.