GitHub¶
Essential setup and configuration for working with GitHub repositories.
SSH Key Setup¶
SSH key generation and keychain management are covered in the Shell section. Follow that guide first to:
- Generate your SSH key with a passphrase
- Configure SSH permissions
- Set up SSH keychain to cache your passphrase
After completing the Shell setup, come back here to push your key to GitHub.
Add SSH Key to GitHub¶
Option 1: Quick Setup with GitHub CLI (Recommended)¶
The fastest way to add your SSH key to GitHub is using the GitHub CLI:
- Install GitHub CLI
# On Ubuntu/WSL
sudo apt-get update
sudo apt-get install gh
# On macOS
brew install gh
# Or download from https://github.com/cli/cli/releases
- Authenticate with GitHub
gh auth login
Follow the prompts: - Select "GitHub.com" - Select "SSH" for git protocol - Use your existing SSH key - Authorize GitHub CLI to manage SSH keys
- Automatic SSH key upload
GitHub CLI will automatically detect your SSH key and upload it to your GitHub account during gh auth login.
- Verify setup
gh auth status
You should see confirmation of your authenticated account.
Option 2: Manual GitHub Web Interface¶
If you prefer the web interface:
- Display your public key:
cat ~/.ssh/id_ed25519.pub
- 
Copy the entire output 
- 
Go to GitHub Settings → SSH and GPG keys → New SSH key 
- 
Paste your public key and give it a descriptive title (e.g., "My Laptop") 
- 
Click "Add SSH key" 
Test SSH Connection¶
Verify your SSH setup works with GitHub:
ssh -T git@github.com
You should see:
Hi YOUR_USERNAME! You've successfully authenticated, but GitHub does not provide shell access.
Basic Git Workflow¶
Clone a Repository¶
git clone git@github.com:USERNAME/repository.git
cd repository
Create and Switch Branches¶
git checkout -b feature/my-feature
Make Changes and Commit¶
git add .
git commit -m "Describe your changes"
Push to GitHub¶
git push origin feature/my-feature
Create a Pull Request¶
After pushing, visit your repository on GitHub and create a pull request to merge your branch.
Cloning Your First Repository¶
Your first GitHub repository can be cloned locally:
git clone git@github.com:YOUR_USERNAME/your-repo.git
cd your-repo
Then you can run Claude Code inside:
claude .