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
1 2 3 4 5 6 7 8 | |
- Authenticate with GitHub
1 | |
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
1 | |
You should see confirmation of your authenticated account.
Option 2: Manual GitHub Web Interface¶
If you prefer the web interface:
- Display your public key:
1 | |
-
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:
1 | |
You should see:
1 | |
Basic Git Workflow¶
Clone a Repository¶
1 2 | |
Create and Switch Branches¶
1 | |
Make Changes and Commit¶
1 2 | |
Push to GitHub¶
1 | |
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:
1 2 | |
Then you can run Claude Code inside:
1 | |