Quick Guide
    ·

    Git & GitHub Quick Reference

    For non-developers building real products

    By The Non-Developer Developer

    The daily workflow

    # Check what's changed in your repo
    git status
    
    # Create a new branch for a feature or fix
    git checkout -b feature-name
    
    # See what you're about to commit
    git diff
    
    # Stage all changes
    git add .
    
    # Stage a specific file
    git add src/components/MyComponent.tsx
    
    # Commit with a clear message
    git commit -m "Add dashboard widget for project count"
    
    # Push branch to GitHub (Vercel creates a preview URL)
    git push origin feature-name
    
    # Switch back to main
    git checkout main
    
    # Pull latest changes from GitHub
    git pull origin main
    

    When something goes wrong

    # Undo the last commit but keep the changes
    git reset --soft HEAD~1
    
    # Undo the last commit and discard the changes (careful)
    git reset --hard HEAD~1
    
    # Discard all uncommitted changes in a file
    git checkout -- src/components/MyComponent.tsx
    
    # Discard ALL uncommitted changes (careful — can't undo)
    git checkout -- .
    
    # Temporarily save changes without committing
    git stash
    
    # Get stashed changes back
    git stash pop
    
    # See recent commits
    git log --oneline
    
    # See what changed in a specific commit
    git show abc1234
    

    Working with branches

    # See all branches
    git branch
    
    # Delete a branch you're done with
    git branch -d feature-name
    
    # Delete a branch on GitHub too
    git push origin --delete feature-name
    
    # Merge a branch into main (do this via PR on GitHub instead)
    git merge feature-name
    

    The pull request workflow

    1. Create a branch: git checkout -b feature-name

    2. Make changes and commit them

    3. Push to GitHub: git push origin feature-name

    4. Go to GitHub → your repo → you'll see a "Compare & pull request" button

    5. Write a brief description of what changed and why

    6. Review the diff — every changed line is visible

    7. Merge when you're happy

    8. Vercel deploys automatically on merge to main


    Key concepts in plain English

    Repository (repo) — the folder containing your project and its entire history

    Commit — a snapshot of your code at a specific moment, with a message describing what changed

    Branch — a separate copy of your code you can work on without affecting main

    Main — the primary branch. What's here gets deployed to production.

    Pull Request (PR) — a request to merge a branch into main. Shows you exactly what changed before anything goes to production.

    Merge — combining a branch back into main

    Clone — making a local copy of a remote repo

    Push — sending your local commits up to GitHub

    Pull — bringing GitHub's latest changes down to your local machine


    The golden rule

    Never work directly on main.

    Always create a branch, do your work, review the diff, then merge. This is true whether you're writing code yourself or using an AI agent. The review step is where you catch problems before they hit production.


    When to ask AI Chat

    I have a git conflict in this file. Here's what I'm seeing:
    [paste conflict markers]
    Explain what each version is and help me understand which one to keep.
    
    I accidentally committed to main instead of a branch.
    How do I undo this without losing my changes?
    
    Explain what this git log output means:
    [paste git log output]