Complete Git and GitHub CLI repository management skill. Use when initializing git repos (git init), generating .gitignore files, creating GitHub repositories, cloning, editing, forking, listing, archiving, syncing, or managing repositories. Also handles GitHub CLI authentication (gh auth login, logout, status, token, refresh). Covers the full workflow from local project initialization to GitHub deployment. Includes git init, .gitignore templates for all major languages/frameworks, gh repo create (with all flags), gh repo edit, clone, fork, list, view, delete, archive/unarchive, sync, rename, deploy-key, and set-default commands.
89%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Low
Low-risk findings worth noting
Complete reference for local git initialization and GitHub CLI commands.
git --version # Verify git is installed
gh auth status # Check GitHub CLI auth
gh auth login # If not authenticatedSee references/auth.md for complete authentication reference.
# Check authentication status
gh auth status
# Login interactively
gh auth login
# Login with browser
gh auth login --web
# Login to GitHub Enterprise
gh auth login --hostname github.example.com
# Logout
gh auth logout
# Get token for scripts
gh auth token
# Refresh credentials / add scopes
gh auth refresh --scopes "admin:org"
# Setup git credential helper
gh auth setup-git| Task | Command |
|---|---|
| Initialize local repo | git init |
| Create .gitignore | See references/gitignore-templates.md |
| Create GitHub repo | gh repo create my-repo --public |
| Full local→GitHub | See workflow below |
| Clone a repo | gh repo clone owner/repo |
| Fork a repo | gh repo fork owner/repo --clone |
Standard workflow to initialize a local project and push to GitHub:
# 1. Navigate to project directory
cd my-project
# 2. Initialize git repository
git init
# 3. Create .gitignore (generate based on project type)
# See references/gitignore-templates.md for templates
# 4. Stage all files
git add .
# 5. Initial commit
git commit -m "Initial commit"
# 6. Create GitHub repo and push
gh repo create my-project --public --source . --push
# Or step by step:
gh repo create my-project --public
git remote add origin https://github.com/USERNAME/my-project.git
git branch -M main
git push -u origin mainInitialize a new git repository in current directory:
git init # Initialize in current directory
git init my-project # Create directory and initialize
git init --initial-branch=main # Specify initial branch nameCreate appropriate .gitignore based on project type. See references/gitignore-templates.md for complete templates.
Quick detection:
package.json → Node.jsrequirements.txt / pyproject.toml → Pythonpom.xml / build.gradle → Javago.mod → GoCargo.toml → Rust*.csproj → .NETGemfile → RubySee references/repo-create.md for all flags.
# Interactive
gh repo create
# Public repo, clone locally
gh repo create my-project --public --clone
# From existing local project
gh repo create --source . --public --push
# With full options
gh repo create my-project --public --description "My project" --gitignore Node --license MITSee references/repo-management.md for all commands.
# Edit settings
gh repo edit --enable-issues --enable-wiki
# Clone
gh repo clone owner/repo
# Fork and clone
gh repo fork owner/repo --clone
# List repos
gh repo list --limit 50
# View repo
gh repo view --web
# Sync fork
gh repo syncmkdir my-app && cd my-app
git init
# Create .gitignore for your stack
echo "# My App" > README.md
git add .
git commit -m "Initial commit"
gh repo create my-app --public --source . --pushcd existing-project
git init
# Create appropriate .gitignore
git add .
git commit -m "Initial commit"
gh repo create existing-project --private --source . --pushgh repo fork owner/project --clone
cd project
git checkout -b my-feature
# Make changes
git add . && git commit -m "Add feature"
git push -u origin my-feature
gh pr create| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Error |
| 2 | Command canceled |
| 4 | Authentication required |
KennethJefferson/cc_skill_gh-repo
821a9ff
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.