FAQ — Git & GitHub¶
💬 Questions that came up during the learning sessions. Updated as we go!
Module 1: Why Version Control + What is Git?¶
How do I check if Git is installed on my machine?
Open a terminal and run:
If you see a version number, Git is installed. If not, download from git-scm.com.Can I open Git and see it like SharePoint or Word?
No — Git is invisible. It has no window or icon. It's a command-line tool you interact with by typing commands like git status and git commit. Think of it like electricity — you can't see it, but it's always there. The only sign of Git is a hidden .git folder inside your project.
Is GitHub required? Can I deploy directly to Azure without it?
Technically, no. You can deploy directly to Azure using swa deploy. But without GitHub, you lose: automatic deploys (GitHub Actions), backup (if your laptop dies, everything is gone), collaboration, and easy rollback. GitHub is your safety net.
If I lose my computer, can I recover from GitHub?
Yes! After every git push, GitHub has a complete copy of your project AND its full history. On a new machine, you just run git clone <repo-url> and everything is restored — every file, every commit, every branch.
Are local and GitHub repos exact mirrors?
Yes, after every git push. They can get out of sync if you make local commits but forget to push. In Git, there's no official "primary" or "secondary" — all copies are equal. In practice, your PC is where you work, and GitHub is the backup + deploy trigger.
Can I work entirely on GitHub without a local copy?
Yes! GitHub offers: (1) the pencil icon to edit single files, (2) github.dev (press . on any repo for VS Code in browser), and (3) GitHub Codespaces — a full cloud development environment with terminal, Git, and all tools. Codespaces has a free tier of 60 hours/month.
Is Git the same as GitHub?
No! Git is the version control tool that runs on your computer (free, open-source, works offline). GitHub is a website/platform where you store and share Git repositories online. Git = the engine, GitHub = the garage.
Should I commit passwords or API keys to Git?
Never! Git keeps everything in its history forever — even after you delete the file. Secrets should be stored securely (environment variables, encrypted backup) and excluded from Git using .gitignore (covered in Module 8).
Who created Git and why?
Linus Torvalds (creator of Linux) built Git in 2005 in just 2 weeks. He needed a fast, distributed version control system for thousands of Linux developers. The name "Git" is British slang for a stubborn person — Linus joked he names projects after himself.
Module 2: The Git Mental Model¶
We haven't used git add (staging) in our website deployments — or have we?
You have! The deploy command git add -A && git commit -m "message" && git push includes git add -A, which stages ALL changes at once. The -A flag makes it automatic, so it feels invisible. In practice, you can also stage selectively: git add menu.md to stage just one file, letting you make cleaner, more focused commits.
How is Git-to-GitHub sync different from OneDrive/Google Drive sync?
The key difference is intentional vs automatic. OneDrive syncs every file change instantly and automatically — no messages, no control. Git only syncs when YOU run git push, and every save (commit) includes a message explaining what changed and why. Git also handles conflicts intelligently (telling you exactly which line), while OneDrive creates messy "conflicted copy" files. Think of OneDrive as a security camera (records everything) and Git as a logbook (clear entries you write yourself).
Module 3: Your First Repository¶
What does git init actually do?
It turns a normal folder into a Git repository by creating a hidden .git folder inside it. This is Git's brain — it stores all history, config, and tracking data. You only run git init once per project, at the very beginning.
Does git init make Git track everything in the folder automatically?
No! git init just tells Git to watch the folder. But Git only tracks files you explicitly add with git add. This is by design — you don't want to track everything (temp files, secrets, build outputs). Use .gitignore to tell Git which files to completely ignore.
What is the LF/CRLF warning about?
It's a harmless warning about line endings. Windows uses CRLF (two characters), while Mac/Linux use LF (one character). Git auto-converts between them. The warning just means "I'll use Windows-style line endings for you." Nothing is wrong — ignore it.
Do I need to specify the file in git commit?
No! git commit saves everything that's currently in the Staging Area (the cart). You already chose what to include at the git add step. git add = pick items. git commit = checkout everything in the cart.
What happens if I try to commit the same file without making changes?
Git is smart — if nothing changed, there's nothing to stage. git add does nothing, and git commit says "nothing to commit, working tree clean." Git only creates commits when there are REAL changes.
Can I use the same commit message twice?
Technically yes — Git doesn't enforce unique messages. Each commit is already unique via its commit ID (hash). But it's bad practice — messages should describe WHAT changed. "Added Mocha to menu" is useful six months later; "update" tells you nothing.
What does 'working tree clean' mean?
It means ALL your changes have been committed. Your Working Directory matches the latest commit in the Repository. Nothing new to stage or save. It's the most satisfying message in Git!
Module 4: What is GitHub?¶
My website repo (aguidetocloud-revamp) is public — is that safe?
Yes! The website content is already publicly visible at aguidetocloud.com, so the source code being public doesn't expose anything new. The dangerous things (passwords, API keys, mcp-config.json) are stored in GitHub Secrets or OneDrive, NOT committed to the repo. Public repos also get unlimited free GitHub Actions minutes, which you'd lose if you went private (private repos get 2,000 min/month on free tier).
What are the implications of making a repo private?
Key changes: (1) GitHub Actions minutes become limited (2,000/month free vs unlimited for public), (2) Nobody can see, fork, or contribute to your code, (3) GitHub Pages requires a paid plan, (4) It disappears from your public portfolio. Rule of thumb: If the content is already public (website, blog), keep the repo public. Make repos private for sensitive data, internal tools, or personal content.
Module 5: Local ↔ Remote¶
Questions will be added as we learn this module.
Module 6: Branches & Merging¶
Questions will be added as we learn this module.
Module 7: Pull Requests & Collaboration¶
Questions will be added as we learn this module.
Module 8: Real-World Git¶
Questions will be added as we learn this module.