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"
- Choose authentication method:
- OAuth (Recommended): Uses VS Code's built-in GitHub authentication
- Personal Access Token: Manual token configuration
- For OAuth:
- Enter connection name and organization (optional)
- Click "Create OAuth Connection"
- Authenticate through VS Code's secure GitHub authentication flow
- For PAT:
- Enter connection details and Personal Access Token
- Save connection
Authentication Methods
OAuth Authentication (Recommended)
OAuth provides the most secure and convenient authentication:
- Select "OAuth" as authentication method
- VS Code will prompt you to sign in to GitHub
- Authorize the application to access your GitHub account
- Connection is automatically configured with secure token management
Benefits:
- No need to create or manage tokens manually
- Automatic token refresh and renewal
- Integrated with VS Code's secure credential storage
- Easy revocation through GitHub's authorized applications
- Supports all GitHub features including private repositories
Personal Access Token (PAT)
For scenarios requiring PAT authentication:
- 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
- Paste token in connection configuration
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 GitHub authentication fails:
For OAuth connections:
- Sign out and sign back in to VS Code's GitHub account
- Check GitHub permissions and authorized applications
- Revoke and re-authorize the application if needed
- Try recreating the OAuth connection
- Ensure you have access to the repositories you're trying to access
For PAT connections:
- Verify PAT is valid and not expired
- Check token permissions and scopes
- Regenerate token if needed
- Reconfigure connection with new token
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