git-integration
Git and GitHub integration patterns including branching, conflict resolution, and GitHub Actions.
Installation
Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.
View source ↗GuidesSkill instructions
Git and GitHub Integration
Patterns for Git workflows, conflict resolution, and GitHub automation.
Core Specialization
- Git Operations: Branching, merging, rebasing, conflict resolution
- GitHub Features: PRs, Issues, Actions, Releases
- Workflow Automation: GitHub Actions, webhooks
- Release Management: Semantic versioning, changelogs
- Repository Management: Branch protection, CODEOWNERS
Execution Rules
- Clean history. Meaningful commits, squash when appropriate
-
Conventional commits.
feat:,fix:,chore:, etc. - PR best practices. Clear description, linked issues
- Conflict resolution. Prefer rebase over merge for feature branches
- Automation. Automate repetitive tasks with Actions
Branch Management
Create Feature Branch
# From latest main
git fetch origin main
git checkout -b feature/task-123 origin/main
Rebase Before PR
git fetch origin main
git rebase origin/main
git push --force-with-lease
Interactive Rebase
# Clean up last 3 commits
git rebase -i HEAD~3
Conflict Resolution
During Rebase
git status # See conflicted files
# Edit files to resolve conflicts
git add <resolved-files>
git rebase --continue
# Abort if needed
git rebase --abort
Resolution Strategy
- Understand both sides of the conflict
- Preserve intent of all changes where possible
- Run tests after resolving
- Document non-obvious resolution decisions
- Escalate if resolution risks breaking functionality
GitHub CLI
# Create PR
gh pr create --title "feat: description" --body "Closes #123"
# List PRs
gh pr list --state open
# Merge PR (squash)
gh pr merge --squash --auto
# Create release
gh release create v1.0.0 --generate-notes
# View PR checks
gh pr checks
GitHub Actions Patterns
Basic CI Workflow
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: make build
- name: Test
run: make test
Auto-merge for Dependabot
name: Dependabot auto-merge
on: pull_request
permissions:
contents: write
pull-requests: write
jobs:
auto-merge:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: Auto-merge
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Conventional Commits
| Prefix | Purpose | Example |
|---|---|---|
feat: |
New feature | feat: add user authentication |
fix: |
Bug fix | fix: resolve login timeout |
docs: |
Documentation | docs: update API reference |
style: |
Formatting | style: fix indentation |
refactor: |
Code refactoring | refactor: extract auth service |
test: |
Adding tests | test: add auth unit tests |
chore: |
Maintenance | chore: update dependencies |
Release Management
Semantic Versioning
- MAJOR (1.x.x): Breaking changes
- MINOR (x.1.x): New features, backward compatible
- PATCH (x.x.1): Bug fixes
Release Process
# Tag release
git tag -a v1.2.0 -m "Release v1.2.0"
git push origin v1.2.0
# Create GitHub release
gh release create v1.2.0 --generate-notes
Guidelines
- Understand both sides of a conflict before resolving
- Preserve intent of all changes where possible
- Run tests after resolving conflicts
- Document non-obvious resolution decisions
- Escalate if resolution risks breaking functionality
Examples
Read the usage examples in the source repository.
View source ↗Source history
- Indexed on
- 2026-01-20
- Index updated
- 2026-03-03
- Branch
- main
Index and sync dates describe this directory. View the source repository for code history.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!