GitHub Integration
Comprehensive GitHub integration for pull requests and code collaboration.
Overview
C# Dev Tools provides full GitHub integration allowing you to manage pull requests, review code, and collaborate without leaving VS Code.
Setup
Connecting to GitHub
- Open Command Palette (
Ctrl+Shift+P
) - Type "Pull Request Manager: Open Connection Manager"
- Click "Add Connection"
- Select "GitHub"
- Enter your Personal Access Token
- Save connection
Creating a Personal Access Token
- Go to GitHub.com → Settings → Developer settings
- Click "Personal access tokens" → "Tokens (classic)"
- Click "Generate new token"
- Select scopes:
repo
(full repository access)read:org
(read organization data)
- Generate and copy the token
Viewing Pull Requests
Assigned to Me
View PRs assigned to you:
- Open Solution Explorer
- Expand "Pull Requests"
- View list of assigned PRs
- Click to open PR details
Created by Me
View PRs you created:
- Filter by author
- See PR status
- Check review status
- View merge status
Review Requested
View PRs where your review is requested:
- See pending reviews
- Priority review queue
- Review status indicators
Creating Pull Requests
From Current Branch
Create PR from your current branch:
- Make changes and commit
- Push to remote
- Click "Create Pull Request" in Pull Requests view
- Fill in details:
- Title
- Description
- Base branch
- Reviewers
- Labels
- Click "Create"
Draft Pull Requests
Create draft PRs for work in progress:
- Check "Create as draft"
- PR is marked as draft
- Convert to ready when complete
Reviewing Pull Requests
Opening a PR
- Click PR in tree view
- PR details open in webview
- See:
- Title and description
- Changed files
- Commits
- Comments
- Checks status
Viewing Changes
View file changes:
- Click "Files Changed" tab
- See unified or split diff
- Navigate between files
- Review line-by-line changes
Adding Comments
Add review comments:
- Click on changed line
- Add comment text
- Submit as:
- Single comment
- Part of review
Submitting Review
Submit complete review:
- Click "Review Changes"
- Add overall comment
- Select:
- Approve
- Request changes
- Comment only
- Submit review
Merging Pull Requests
Merge Options
Merge PRs when approved:
- Merge commit: Standard merge with commit
- Squash and merge: Single commit with all changes
- Rebase and merge: Rebase onto base branch
Requirements
Before merging, ensure:
- All checks pass
- Required reviews approved
- No conflicts
- Branch is up to date
Pull Request Actions
Additional PR actions:
- Close: Close without merging
- Reopen: Reopen closed PR
- Edit: Update title/description
- Convert to draft: Mark as work in progress
- Request reviewers: Add more reviewers
Status Indicators
PR status indicators:
- 🟢 Open and ready
- 🟡 Draft
- 🔴 Conflicts
- ✅ Approved
- ⏳ Pending reviews
- 🚀 Checks passing
Best Practices
- Keep PRs focused and small
- Write clear descriptions
- Request appropriate reviewers
- Respond to feedback promptly
- Keep branch up to date
- Squash commits for cleaner history
Troubleshooting
Authentication Failed
If authentication fails:
- Verify PAT is valid
- Check token permissions
- Regenerate token if needed
- Reconfigure connection
PRs Not Loading
If PRs don't load:
- Check internet connection
- Verify GitHub is accessible
- Refresh the PR list
- Check repository permissions
Can't Create PR
If PR creation fails:
- Ensure branch is pushed to remote
- Check write permissions
- Verify base branch exists
- Check for conflicts