← Lesson
BitWithBite
Git & GitHub · Quick Reference

Lesson 5 — GitHub Essentials Cheat Sheet

Git & GitHub
In one line: GitHub is a cloud-based hosting platform for Git repositories. While Git is the tool that tracks your code history on your computer, GitHub lets you store that history online — ...

Key Ideas

1What is GitHub?. GitHub is a cloud-based hosting platform for Git repositories. While Git is the tool that tracks your code history on your computer, GitHub lets you store that history...
2Creating a GitHub Account & Repository. Head to github.com and sign up for a free account. Choose your username carefully — it becomes part of your GitHub profile URL (github.com/yourusername) and will be se...
3Connecting Local to Remote. After creating a GitHub repo, you need to link your local Git repository to it. The remote is given an alias — by convention it's called origin.
4SSH Key Setup. SSH keys work like a lock and key. You generate a key pair — a private key that stays on your machine and a public key that you share with GitHub. When you connect, Gi...
5Your First Push. With your remote connected and SSH key set up, you're ready to push your local commits to GitHub. The first push uses -u to set up upstream tracking — after that, a si...

Code Examples

# Add the remote (replace with your actual repo URL) git remote add origin git@github.com:username/my-repo.git # Verify the remote was added git remote -v # Output: # origin git@github.com:username/my-repo.git (fetch) # origin git@github.com:username/my-...
# Step 1: Generate a new SSH key (use your GitHub email) ssh-keygen -t ed25519 -C "you@email.com" # Press Enter to accept default location (~/.ssh/id_ed25519) # Enter a passphrase (optional but recommended) # Step 2: Start the SSH agent eval "$(ssh-agent -...
# First push: -u sets up tracking (do this once per branch) git push -u origin main # After that, just: git push # Pull remote changes to your local repo git pull origin main # Or just: git pull # Fetch without merging (inspect before applying) git fetch...