Expert guidance for Git version control, trunk-based development workflows, and GitHub best practices. Emphasizes Conventional Commits for clean history, short-lived feature branches, frequent integration, and professional collaboration patterns. Use when users need help with git commands, branching strategies, commit messages, PRs, merge conflicts, or git troubleshooting.
Expert guidance for Git version control, trunk-based development workflows, and GitHub best practices.
This skill provides comprehensive support for Git version control, with an emphasis on:
Invoke this skill when you need help with:
Learn and apply trunk-based development workflow:
Master structured commit messages:
Professional GitHub collaboration:
Comprehensive Git knowledge:
Complete skill prompt with:
references/conventional-commits.md
references/trunk-based-development.md
references/github-workflow.md
references/git-commands.md
references/troubleshooting.md
references/advanced-git.md
assets/templates/pr-template.md
assets/templates/commit-message-template.md
examples/commit-examples.md
# 1. Start from updated main
git checkout main
git pull origin main
# 2. Create feature branch
git checkout -b feat/new-feature
# 3. Make changes and commit
git add .
git commit -m "feat(module): add new functionality"
# 4. Keep branch updated
git rebase main
# 5. Push and create PR
git push -u origin feat/new-feature
# Create PR on GitHub
# 6. After merge, cleanup
git checkout main
git pull origin main
git branch -d feat/new-feature
<type>(<scope>): <subject>
<body>
<footer>
Example:
feat(auth): add OAuth2 authentication
Implement OAuth2 flow for Google and GitHub providers.
Users can now sign in with their existing accounts.
Closes #123
# Status and changes
git status
git diff
git log --oneline
# Committing
git add .
git commit -m "type(scope): message"
git commit --amend
# Branching
git checkout -b feat/branch-name
git checkout main
git branch -d feature-branch
# Syncing
git pull origin main
git push origin feature-branch
git rebase main
# Undoing
git reset HEAD~1 # Undo commit, keep changes
git reset --hard HEAD~1 # Undo commit, discard changes
git revert abc123 # Revert commit (safe for pushed commits)
Main branch is the source of truth:
Feature branches are temporary:
Commit messages are documentation:
Pull requests enable collaboration:
# User configuration
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
# Editor
git config --global core.editor "vim"
# Default branch
git config --global init.defaultBranch main
# Rebase by default
git config --global pull.rebase true
# Helpful aliases
git config --global alias.st status
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.lg "log --oneline --graph --decorate"
Commit message helpers:
GitHub tools:
Merge tools:
Start with:
Study:
Master:
See: SKILL.md → "Starting New Feature"
See: SKILL.md → "Quick Bug Fix"
See: SKILL.md → "Updating Branch from Main"
See: SKILL.md → "Handling Merge Conflicts"
See: references/troubleshooting.md → specific issue
See: references/github-workflow.md → "Creating a Pull Request"
Q: When should I use merge vs rebase? A: Use rebase for feature branches (clean history), merge for shared branches (preserves collaboration history).
Q: How often should I commit? A: Commit frequently (multiple times per day) at logical stopping points. Each commit should represent a complete, working change.
Q: How small should PRs be? A: Aim for 50-200 lines changed. Definitely split if over 500 lines. Small PRs get reviewed faster and more thoroughly.
Q: When should I use feature flags? A: Use feature flags when work takes more than 3 days or when you want to merge incomplete features to main without exposing to users.
Q: Should I squash commits before merging? A: Generally yes for feature branches - it keeps main branch history clean. Keep detailed commits in feature branch for review.
Q: How do I recover from mistakes?
A: Check reflog first (git reflog), which tracks all ref updates. Most mistakes are recoverable. See references/troubleshooting.md for specific scenarios.
Found an issue or have a suggestion? The skill can be improved through:
Remember: Good version control is about clear history, frequent integration, and effective collaboration. Master the basics, then gradually adopt advanced techniques as needed.
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer