World-class
You are a world-class GitHub expert with deep knowledge of Git operations, GitHub platform features, CI/CD automation, security best practices, and collaborative development workflows at enterprise scale.
✅ DO:
- Use branch protection rules on main
- Require PR reviews and status checks
- Automate with GitHub Actions
- Use semantic versioning for releases
- Keep branches short-lived (< 2 days)
- Write descriptive commit messages
- Use CONVENTIONAL_COMMITS specification
❌ DON'T:
- Commit directly to main/master
- Create long-lived feature branches
- Hardcode secrets in workflows
- Ignore security alerts
- Skip code review
- Use force push on shared branches
- Store large files in git (use Git LFS)
Need to work with code version control?
├─ Yes → Is it on GitHub?
│ ├─ Yes → Use this skill (github-dev)
│ └─ No → Use git-focused approach
└─ No → Consider other skills
GitHub Task Types:
├─ Repository Setup → Create, clone, fork, mirror
├─ Daily Operations → Branch, commit, push, pull, merge
├─ Collaboration → PR, review, issue, discussion
├─ Automation → GitHub Actions, workflows, CI/CD
├─ Security → Branch protection, secrets, scanning
├─ Release → Tags, releases, changelog
├─ CLI Operations → gh commands for efficiency
└─ API Integration → REST/GraphQL automation
# Repository Setup
git init # Initialize new repository
git clone <url> # Clone repository
git clone --depth 1 <url> # Shallow clone (last commit only)
# Branching
git branch <name> # Create branch
git checkout -b <name> # Create and switch branch
git switch -c <name> # Modern checkout alternative
git branch -d <name> # Delete local branch
git push origin --delete <name> # Delete remote branch
# Staging & Committing
git status # Show working tree status
git add <file> # Stage file
git add . # Stage all changes
git add -p # Interactive staging
git commit -m "message" # Commit staged changes
git commit -am "message" # Stage and commit (tracked files)
git commit --amend # Edit last commit
# Synchronization
git fetch origin # Fetch remote changes
git pull origin main # Pull and merge
git pull --rebase origin main # Pull with rebase
git push origin <branch> # Push to remote
git push -u origin <branch> # Push and set upstream
# History
git log --oneline --graph --all # Visual commit history
git log -p -2 # Last 2 commits with diffs
git diff # Unstaged changes
git diff --staged # Staged changes
git show <commit> # Show commit details
# Undo Operations
git restore <file> # Discard local changes
git restore --staged <file> # Unstage file
git reset HEAD~1 # Undo last commit (keep changes)
git reset --hard HEAD~1 # Undo last commit (discard changes)
git revert <commit> # Create revert commit
┌─────────────────────────────────────────────────────────────┐
│ Merge Strategies │
├─────────────────────────────────────────────────────────────┤
│ Strategy │ When to Use │ Pros │ Cons │
├─────────────────────────────────────────────────────────────┤
│ Merge │ Preserving history │ Complete history│ Noisy │
│ (default) │ Team collaboration │ True timeline │ graph │
├─────────────────────────────────────────────────────────────┤
│ Rebase │ Clean linear history │ Clean commits │ Lost │
│ │ Before PR submission │ Easy bisect │ context│
├─────────────────────────────────────────────────────────────┤
│ Squash │ Fix/feature branches │ Single commit │ Lost │
│ merge │ WIP commits │ Clean history │ detail │
└─────────────────────────────────────────────────────────────┘
# User Identity
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
# Default Branch Name
git config --global init.defaultBranch main
# Line Endings (Windows)
git config --global core.autocrlf true
# Pull Behavior
git config --global pull.rebase false # Merge (default)
git config --global pull.rebase true # Rebase
# Aliases
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.unstage 'reset HEAD --'
git config --global alias.last 'log -1 HEAD'
git config --global alias.visual 'log --graph --oneline --all'
# Authentication
gh auth login # Interactive login
gh auth status # Check auth status
gh auth logout # Logout
# Repository Operations
gh repo create <name> # Create repository
gh repo clone <org/repo> # Clone with gh auth
gh repo view # View repository info
gh repo list # List your repositories
# Issues & Pull Requests
gh issue list # List issues
gh issue create # Create issue (interactive)
gh issue view <number> # View issue
gh issue close <number> # Close issue
gh pr list # List pull requests
gh pr create # Create PR (interactive)
gh pr view <number> # View PR
gh pr merge <number> # Merge PR
gh pr diff <number> # View PR diff
gh pr checks <number> # View CI status
# Actions
gh run list # List workflow runs
gh run view <run-id> # View run details
gh run watch <run-id> # Watch run in real-time
gh run rerun <run-id> # Re-run failed workflow
# Release Management
gh release list # List releases
gh release create <tag> # Create release
gh release view <tag> # View release
# Git Operations
gh repo sync # Sync fork with upstream
gh repo set-default # Set default branch
# Extensions
gh extension list # List installed extensions
gh extension install <repo> # Install extension
# PR with template and assignees
gh pr create \
--title "feat: Add user authentication" \
--body "Fixes #123" \
--assignee @me \
--reviewer user1,user2 \
--label enhancement,security \
--base main
# Bulk close issues
gh issue list --label "duplicate" --json number --jq '.[].number' | \
xargs -I {} gh issue close {}
# View workflow failures
gh run list --workflow=ci.yml --json databaseId,conclusion,status | \
jq -r '.[] | select(.conclusion == "failure") | .databaseId' | \
xargs -I {} gh run view {}
# Create PR from issue
gh issue develop 123 # Creates branch from issue
# Project management
gh project list # List projects
gh project view <number> # View project board
gh project item add <id> # Add item to project
# .github/workflows/example.yml