원클릭으로
repository-management
Manage GitHub repositories - create, fork, branch, and file operations using gh CLI
메뉴
Manage GitHub repositories - create, fork, branch, and file operations using gh CLI
GitHub code review operations - approve PRs, request changes, comment on code, and manage review workflows using gh CLI
View and analyze commits in GitHub repositories - commit history, diffs, and commit details using gh CLI
Manage GitHub gists - create, edit, list, and share code snippets using gh CLI
Work with GitHub issues - create, list, update, comment, and search issues using gh CLI
Manage GitHub labels - create, edit, delete, apply labels, and organize with color coding using gh CLI
GitHub PR operations - create, list, merge, update, and manage pull requests using gh CLI
| name | repository-management |
| description | Manage GitHub repositories - create, fork, branch, and file operations using gh CLI |
This skill provides comprehensive repository management operations including creating repositories, managing branches, and working with files.
Create a new GitHub repository in your account or organization.
Fork an existing repository to your account or specified organization.
Create a new branch in a repository from an existing branch.
Search for GitHub repositories using GitHub's search syntax.
Retrieve the contents of a file or directory from a repository.
Create a new file or update an existing file in a repository.
Push multiple files to a repository in a single commit.
Public repository:
gh repo create my-awesome-project --public --description "My awesome project" --clone
Private repository:
gh repo create my-private-repo --private --description "Private project" --clone
With README initialization:
gh repo create my-project --public --add-readme
Fork to your personal account:
gh repo fork owner/repo-name --clone
Fork to an organization:
gh repo fork owner/repo-name --org my-org --clone
Fork without cloning:
gh repo fork owner/repo-name
Create from default branch:
gh api repos/owner/repo-name/git/refs -f ref=refs/heads/new-feature -f sha=$(gh api repos/owner/repo-name/git/refs/heads/main --jq '.object.sha')
Using Git directly (if repo is cloned):
cd repo-name
git checkout -b new-feature
git push -u origin new-feature
Search by keyword:
gh search repos "machine learning" --limit 20
Search with filters:
gh search repos "web framework" --language python --stars ">1000" --limit 10
Search in organization:
gh search repos "org:myorg" --limit 50
Search by topic:
gh search repos "topic:docker" --stars ">100"
View file contents:
gh api repos/owner/repo-name/contents/path/to/file.txt --jq '.content' | base64 -d
List directory contents:
gh api repos/owner/repo-name/contents/path/to/directory
Get file from specific branch:
gh api repos/owner/repo-name/contents/README.md?ref=develop --jq '.content' | base64 -d
Create a new file:
echo "file content" | gh api repos/owner/repo-name/contents/path/to/newfile.txt \
-X PUT \
-f message="Add new file" \
-f content=$(echo "file content" | base64) \
-f branch=main
Update an existing file (requires SHA):
# First, get the file SHA
SHA=$(gh api repos/owner/repo-name/contents/path/to/file.txt --jq '.sha')
# Then update
echo "updated content" | gh api repos/owner/repo-name/contents/path/to/file.txt \
-X PUT \
-f message="Update file" \
-f content=$(echo "updated content" | base64) \
-f sha="$SHA" \
-f branch=main
For pushing multiple files, it's recommended to clone the repository and use Git:
# Clone the repository
gh repo clone owner/repo-name
cd repo-name
# Create/modify multiple files
echo "content1" > file1.txt
echo "content2" > file2.txt
mkdir -p src
echo "code" > src/main.py
# Commit and push
git add .
git commit -m "Add multiple files"
git push
Alternative: Using GitHub API for multiple files (requires tree/commit API):
# This is more complex and typically requires a script
# Recommended to use Git directly for multiple files
# Create repository
gh repo create my-project --public --clone
cd my-project
# Add initial files
echo "# My Project" > README.md
echo "print('Hello')" > main.py
# Commit and push
git add .
git commit -m "Initial commit"
git push -u origin main
# Fork the repository
gh repo fork upstream/repo-name --clone
cd repo-name
# Create feature branch
git checkout -b my-feature
# Make changes
echo "new feature" > feature.txt
git add feature.txt
git commit -m "Add new feature"
# Push branch
git push -u origin my-feature
# Create PR (using pull-request-management skill)
gh pr create --title "Add new feature" --body "Description of changes"
# Ensure you're authenticated
gh auth status
# Clone
gh repo clone owner/private-repo
# Check if repo exists first
gh repo view owner/repo-name 2>/dev/null && echo "Exists" || echo "Does not exist"
# Verify authentication and permissions
gh auth status
# Try refreshing credentials
gh auth refresh
# Verify the file path exists
gh api repos/owner/repo-name/contents/path/to/file.txt 2>&1 | grep -q "Not Found" && echo "File does not exist"
owner/repo-name not just repo-namegh auth status before operationsissue-management - Create and manage issuespull-request-management - Work with pull requestscommit-operations - View commit history