Welcome! This guide will help you set up Git and GitHub on your computer. Don't worry if you're new to this - we'll go step by step!
- ✅ What Git and GitHub are (and why they're awesome!)
- ✅ How to install Git on your computer
- ✅ How to create a GitHub account
- ✅ How to configure Git with your details
- ✅ How to verify everything is working
- What: A tool that tracks changes in your code
- Why: Never lose your work, see what you changed, collaborate with others
- Think of it as: A super-powered "Save" button with history
- What: A website that stores your Git repositories online
- Why: Backup your code, share with others, collaborate on projects
- Think of it as: Google Drive, but for programmers
- Go to: github.com
- Click: "Sign up" (top-right corner)
- Choose:
- Username: Pick something professional (e.g.,
john_doe,jane_smith) - Email: Use your real email (you'll need to verify it)
- Password: Make it strong!
- Username: Pick something professional (e.g.,
- Verify: Check your email and click the verification link
- Done: You now have a GitHub account! 🎉
- ✅ Use your real name if possible (employers like this)
- ✅ Keep it simple and professional
- ❌ Avoid special characters or numbers if possible
- ❌ Don't use temporary email addresses
-
Download: Go to git-scm.com
-
Click: "Download for Windows"
-
Run: The downloaded installer
-
Installation Options (recommended settings):
- ✅ Git Bash Here (adds right-click option)
- ✅ Git GUI Here
- ✅ Git LFS (Large File Support)
- ✅ Associate .git* configuration files
- ✅ Associate .sh files to be run with Bash
- Choose: "Use Git from Git Bash only" (safest option)
- Choose: "Use the OpenSSL library"
- Choose: "Checkout Windows-style, commit Unix-style line endings"
- Choose: "Use MinTTY"
- ✅ Enable file system caching
- ✅ Enable Git Credential Manager
-
Finish: Complete the installation
Option 1: Using Homebrew (Recommended)
# Install Homebrew first (if you don't have it)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Git
brew install gitOption 2: Download Installer
- Go to git-scm.com
- Click "Download for Mac"
- Run the installer
Ubuntu/Debian:
sudo apt update
sudo apt install gitCentOS/RHEL/Fedora:
sudo yum install git
# or for newer versions:
sudo dnf install gitAfter installing Git, you need to tell it who you are:
- Windows: Search for "Git Bash" and open it
- Mac: Open "Terminal" application
- Linux: Open your terminal
# Set your name (use your real name)
git config --global user.name "Your Full Name"
# Set your email (use the same email as your GitHub account)
git config --global user.email "your.email@example.com"
# Set default branch name to 'main' (modern standard)
git config --global init.defaultBranch main# Check if everything is set correctly
git config --list --global
# Should show something like:
# user.name=Your Full Name
# user.email=your.email@example.com
# init.defaultbranch=main- Go to GitHub: github.com
- Navigate: Settings → Developer settings → Personal access tokens → Tokens (classic)
- Create: "Generate new token (classic)"
- Configure:
- Note: "CDAC Python Course"
- Expiration: 90 days (or custom)
- Scopes: Check "repo" (gives full repository access)
- Generate: Click "Generate token"
- Save: Copy the token immediately (you won't see it again!)
When cloning/pushing: Use your GitHub username and the token as password.
# Generate SSH key
ssh-keygen -t ed25519 -C "your.email@example.com"
# Start SSH agent
eval "$(ssh-agent -s)"
# Add key to agent
ssh-add ~/.ssh/id_ed25519
# Copy public key (then paste in GitHub)
cat ~/.ssh/id_ed25519.pubAdd the public key to GitHub: Settings → SSH and GPG keys → New SSH key
# Check Git version
git --version
# Should output something like: git version 2.40.0For HTTPS:
# Try cloning a test repository
git clone https://github.com/octocat/Hello-World.git
cd Hello-World
lsFor SSH:
# Test SSH connection
ssh -T git@github.com
# Should output: Hi username! You've successfully authenticated...If you've made it this far, congratulations! 🎊 You now have:
- ✅ A GitHub account
- ✅ Git installed on your computer
- ✅ Git configured with your details
- ✅ Authentication set up
- Go back to: Main README
- Fork: The course repository
- Clone: Your fork to start working
- Start: Your Python journey with proper version control!
❓ "git: command not found"
- Solution: Git isn't installed or not in PATH. Reinstall Git and restart terminal.
❓ "Permission denied (publickey)"
- Solution: SSH key isn't set up correctly. Use HTTPS instead or follow SSH setup again.
❓ "Authentication failed"
- Solution:
- For HTTPS: Use personal access token, not your password
- For SSH: Check if your SSH key is added to GitHub
❓ "fatal: not a git repository"
- Solution: You're not in a Git repository folder. Navigate to the right folder or clone a repository first.
- Ask: Harshal or classmates
- Check: GitHub's documentation
- Search: Stack Overflow for specific error messages
💡 Pro Tip: Don't worry if this seems overwhelming! Git has a learning curve, but once you get it, you'll wonder how you ever coded without it!