Git & GitHub Setup
chro uses Git for version control and GitHub for collaboration. This guide covers installation and SSH key setup for both platforms.
Check Existing Installation
Section titled “Check Existing Installation”First, check if Git is already installed:
git --versionIf Git is installed, you’ll see a version number. Otherwise, follow the installation instructions below.
Option 1: Xcode Command Line Tools (Recommended)
Section titled “Option 1: Xcode Command Line Tools (Recommended)”The easiest way to get Git on macOS:
xcode-select --installA dialog will appear. Click “Install” and wait for completion.
Option 2: Homebrew
Section titled “Option 2: Homebrew”If you have Homebrew installed:
brew install gitVerify Installation
Section titled “Verify Installation”git --version # Should show git version 2.x.xWindows
Section titled “Windows”Option 1: winget (Recommended)
Section titled “Option 1: winget (Recommended)”Using the Windows Package Manager:
winget install Git.GitNote: Restart your terminal after installation.
Option 2: Git for Windows Installer
Section titled “Option 2: Git for Windows Installer”- Download from git-scm.com
- Run the installer
- Use default settings (recommended for beginners)
- Ensure “Git from the command line and also from 3rd-party software” is selected
Verify Installation
Section titled “Verify Installation”Open a new terminal/PowerShell window:
git --versionInitial Git Configuration
Section titled “Initial Git Configuration”Configure your identity (required for commits):
git config --global user.name "Your Name"Set default branch name to main:
git config --global init.defaultBranch mainVerify your configuration:
git config --listGitHub Account Setup
Section titled “GitHub Account Setup”If you don’t have a GitHub account:
- Go to github.com
- Click “Sign up”
- Follow the registration process
- Verify your email address
SSH Key Setup (Recommended)
Section titled “SSH Key Setup (Recommended)”SSH keys provide secure, password-less authentication with GitHub.
Generate SSH Key
Section titled “Generate SSH Key”macOS / Linux / Windows (Git Bash or WSL):
When prompted:
- Press Enter to accept the default file location
- Enter a passphrase (recommended) or press Enter for no passphrase
Windows (PowerShell):
Start SSH Agent
Section titled “Start SSH Agent”macOS:
eval "$(ssh-agent -s)"Add to ~/.ssh/config (create if it doesn’t exist):
Host github.com AddKeysToAgent yes UseKeychain yes IdentityFile ~/.ssh/id_ed25519Add your key:
ssh-add --apple-use-keychain ~/.ssh/id_ed25519Windows (PowerShell - Run as Administrator):
# Start the ssh-agent serviceGet-Service -Name ssh-agent | Set-Service -StartupType AutomaticStart-Service ssh-agent
# Add your keyssh-add $env:USERPROFILE\.ssh\id_ed25519Linux / WSL:
eval "$(ssh-agent -s)"ssh-add ~/.ssh/id_ed25519Add SSH Key to GitHub
Section titled “Add SSH Key to GitHub”1. Copy your public key:
macOS:
pbcopy < ~/.ssh/id_ed25519.pubWindows (PowerShell):
Get-Content $env:USERPROFILE\.ssh\id_ed25519.pub | Set-ClipboardLinux:
cat ~/.ssh/id_ed25519.pub# Then manually copy the output2. Add to GitHub:
- Go to GitHub Settings > SSH Keys
- Click “New SSH key”
- Give it a descriptive title (e.g., “MacBook Pro 2024”)
- Paste your key into the “Key” field
- Click “Add SSH key”
Test Connection
Section titled “Test Connection”You should see:
Hi username! You've successfully authenticated, but GitHub does not provide shell access.Alternative: HTTPS with Personal Access Token
Section titled “Alternative: HTTPS with Personal Access Token”If you prefer HTTPS over SSH:
Create Personal Access Token
Section titled “Create Personal Access Token”- Go to GitHub Settings > Developer Settings > Personal Access Tokens
- Click “Generate new token (classic)”
- Give it a descriptive name
- Select scopes:
repo(full control of private repositories) - Click “Generate token”
- Copy the token immediately (you won’t see it again)
Configure Git Credential Storage
Section titled “Configure Git Credential Storage”macOS:
git config --global credential.helper osxkeychainWindows:
git config --global credential.helper wincredWhen you first push/pull, enter your GitHub username and use the token as your password.
Verify GitHub Connection
Section titled “Verify GitHub Connection”Test by cloning a repository:
# SSH (recommended)
# Or HTTPSgit clone https://github.com/octocat/Hello-World.gitIf successful, you’re ready to use Git with GitHub!
Troubleshooting
Section titled “Troubleshooting””Permission denied (publickey)”
Section titled “”Permission denied (publickey)””- Ensure your SSH key is added to the agent:
ssh-add -l - Verify the key is added to GitHub: github.com/settings/keys
- Check you’re using the correct key:
ssh -vT [email protected]
”Could not open a connection to your authentication agent”
Section titled “”Could not open a connection to your authentication agent””Start the SSH agent:
eval "$(ssh-agent -s)"Git asks for password on every push (HTTPS)
Section titled “Git asks for password on every push (HTTPS)”Configure credential storage:
# macOSgit config --global credential.helper osxkeychain
# Windowsgit config --global credential.helper wincred
# Linuxgit config --global credential.helper storeLine ending issues (Windows)
Section titled “Line ending issues (Windows)”Configure Git to handle line endings:
git config --global core.autocrlf trueNext Steps
Section titled “Next Steps”Once Git and GitHub are configured, proceed to:
- AI Coding Tools Setup - Install Claude Code or OpenAI Codex
- chro Installation - Install chro