What is GitHub?
GitHub is a platform for hosting Git repositories, collaborating on code, and deploying projects. You’ll use it to store your code and optionally deploy it.
Create an Account
- Go to github.com and sign up
- Verify your email address
- Optionally set up a profile picture and bio
Set Up SSH Keys (Recommended)
SSH keys let you push/pull code without entering your password each time.
Generate a Key
ssh-keygen -t ed25519 -C "your.email@example.com"Press Enter to accept the default file location. Optionally set a passphrase.
Add the Key to GitHub
- Copy your public key:
# macOS
cat ~/.ssh/id_ed25519.pub | pbcopy
# Linux
cat ~/.ssh/id_ed25519.pub | xclip -selection clipboard
# Windows (Git Bash)
cat ~/.ssh/id_ed25519.pub | clip- Go to GitHub SSH Settings
- Click New SSH key
- Paste the key and give it a title (e.g., “My Laptop”)
- Click Add SSH key
Test the Connection
ssh -T git@github.comYou should see: “Hi username! You’ve successfully authenticated.”
Create a Repository
- Click the + icon in the top-right corner of GitHub
- Select New repository
- Name it (e.g.,
my-project) - Choose Public or Private
- Check Add a README file
- Click Create repository
Clone to Your Machine
git clone git@github.com:your-username/my-project.git
cd my-projectFor deploying static sites, see Deploying with GitHub Pages.