GitHub Setup Guide for Quantum Platform
Prerequisites
- GitHub Account: You need a GitHub account
- SSH Key: Set up SSH key for authentication (recommended)
- Organization: Consider creating a GitHub organization for the project
Step-by-Step Setup
1. Create GitHub Repository
Option A: Using GitHub Web Interface (Recommended)
- Go to GitHub.com and sign in
- Click the "+" icon in the top right corner
- Select "New repository"
- Fill in the details:
- Repository name:
quantum-platform - Description:
Quantum Platform - Enterprise-grade development platform - Visibility: Private (recommended for platform development)
- Initialize: Do NOT initialize with README, .gitignore, or license (we already have these)
- Repository name:
- Click "Create repository"
Option B: Using GitHub CLI (if installed)
gh repo create quantum-platform --private --description "Quantum Platform - Enterprise-grade development platform"
2. Set Up SSH Authentication (Recommended)
Check if you have SSH keys:
ls -la ~/.ssh
If no SSH keys exist, create them:
ssh-keygen -t ed25519 -C "your-email@example.com"
# Press Enter to accept default file location
# Enter a passphrase (optional but recommended)
Add SSH key to GitHub:
# Copy your public key
cat ~/.ssh/id_ed25519.pub
- Go to GitHub Settings → SSH and GPG keys
- Click "New SSH key"
- Paste your public key
- Give it a title (e.g., "Quantum Platform Development")
- Click "Add SSH key"
Test SSH connection:
ssh -T git@github.com
3. Connect Local Repository to GitHub
Once you have the repository URL from GitHub, run these commands:
cd /home/dnatter/quantum
# Add GitHub as remote origin (replace with your actual repository URL)
git remote add origin git@github.com:YOUR_USERNAME/quantum-platform.git
# Verify remote is added
git remote -v
# Push main branch
git checkout main
git push -u origin main
# Push develop branch
git checkout develop
git push -u origin develop
# Push current feature branch
git checkout feature/QUANTUM-001-setup-git-workflow
git push -u origin feature/QUANTUM-001-setup-git-workflow
4. Set Up Branch Protection Rules
For Main Branch:
- Go to your repository on GitHub
- Click Settings → Branches
- Click "Add rule"
- Configure:
- Branch name pattern:
main - ✅ Require a pull request before merging
- ✅ Require approvals: 2
- ✅ Dismiss stale PR approvals when new commits are pushed
- ✅ Require status checks to pass before merging
- ✅ Require branches to be up to date before merging
- ✅ Restrict pushes that create files larger than 100MB
- Branch name pattern:
For Develop Branch:
- Add another rule for
develop - Configure:
- Branch name pattern:
develop - ✅ Require a pull request before merging
- ✅ Require approvals: 1
- ✅ Require status checks to pass before merging
- Branch name pattern:
5. Set Up GitHub Actions (CI/CD)
Create the workflow file:
mkdir -p .github/workflows
The workflow file is already created at .github/workflows/guardrails.yml
6. Configure Repository Settings
General Settings:
- Go to Settings → General
- Enable "Issues" and "Projects"
- Set up "Discussions" if needed
- Configure "Pages" for documentation hosting
Security Settings:
- Go to Settings → Security
- Enable "Dependency graph"
- Enable "Dependabot alerts"
- Enable "Dependabot security updates"
- Enable "Code scanning" (GitHub Advanced Security if available)
7. Set Up Team Access (if using organization)
- Go to Settings → Manage access
- Add team members with appropriate permissions:
- Admin: Platform architects
- Maintain: Platform team leads
- Write: Development team members
- Read: Stakeholders and observers
8. Create Issue and PR Templates
Issue Template:
mkdir -p .github/ISSUE_TEMPLATE
Create .github/ISSUE_TEMPLATE/bug_report.md:
---
name: Bug report
about: Create a report to help us improve
title: '[BUG] '
labels: bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Environment:**
- OS: [e.g. Ubuntu 20.04]
- Version: [e.g. v1.2.0]
- Browser: [e.g. chrome, safari]
**Additional context**
Add any other context about the problem here.
PR Template:
Create .github/pull_request_template.md:
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
## How Has This Been Tested?
- [ ] Unit tests pass
- [ ] Integration tests pass
- [ ] Manual testing completed
## Checklist
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published
## Screenshots (if applicable)
Add screenshots to help explain your changes.
## Additional Notes
Add any additional notes about the changes here.
9. Set Up Repository Secrets
Go to Settings → Secrets and variables → Actions and add:
AZURE_CLIENT_IDAZURE_CLIENT_SECRETAZURE_TENANT_IDAZURE_SUBSCRIPTION_ID- Any other environment-specific secrets
10. Verify Setup
Run these commands to verify everything is working:
# Check remote configuration
git remote -v
# Check branch status
git branch -a
# Test workflow script
./scripts/git-workflow.sh status
# Create a test feature branch
./scripts/git-workflow.sh feature test-github-integration
# Make a small change and commit
echo "# Test GitHub Integration" >> README.md
git add README.md
git commit -m "test: verify GitHub integration"
# Push the test branch
git push origin feature/test-github-integration
Troubleshooting
SSH Key Issues
# Test SSH connection
ssh -T git@github.com
# If permission denied, check SSH agent
ssh-add -l
# Add key to SSH agent
ssh-add ~/.ssh/id_ed25519
Remote URL Issues
# Check current remote
git remote -v
# Update remote URL if needed
git remote set-url origin git@github.com:YOUR_USERNAME/quantum-platform.git
Permission Issues
- Ensure you have write access to the repository
- Check if you're using the correct SSH key
- Verify your GitHub account has the necessary permissions
Next Steps After Setup
- Create your first Pull Request from the feature branch to develop
- Set up automated testing in GitHub Actions
- Configure deployment pipelines for staging and production
- Set up monitoring and alerting for the repository
- Train team members on the Git workflow
Support
If you encounter issues:
- Check the GitHub documentation
- Review the Git workflow guide in
docs/development/git-workflow.md - Ask for help in team channels
- Escalate to platform architects for complex issues