taskmanager. He creates the folder, writes app.py, requirements.txt, and README.md — then his senior says: "Now make Git watch this folder forever."
Before branches or GitHub, there's one machine, one folder, and three simple stages. Master this and everything else is a variation on the theme.
taskmanager. He creates the folder, writes app.py, requirements.txt, and README.md — then his senior says: "Now make Git watch this folder forever."
$ mkdir taskmanager && cd taskmanager $ git init Initialized empty Git repository in /home/alex/taskmanager/.git/
git init doesn't create your files — it plants a hidden brain (the .git folder) next to them that will remember every version of every file, forever, from this second onward.git init Actually CreatesThe .git/ folder is Git's memory. Never delete it — that's your entire project history, gone.
git config# Run ONCE per machine — applies to every repo git config --global user.name "Alex Mercer" git config --global user.email "alex@techlabs.com" git config --global init.defaultBranch main
| Config level | Scope & file |
|---|---|
--system | All users on the machine — /etc/gitconfig |
--global | Your user account only — ~/.gitconfig |
--local (default) | This repository only — .git/config |
git config user.email "..." (no --global) for a client's private repo.Click Step to move app.py through all three stages:
# Always run this first — see what changed git status # Stage files git add . # all modified/new files (NOT deletions) git add app.py # one specific file git add -A # everything, including deletions # Commit — the permanent snapshot git commit -m "feat: add MongoDB database module and env template"
| Command | Stages |
|---|---|
git add . | All modified and new files in current directory |
git add filename | Only that specific file |
git add src/ | Everything inside the src/ directory |
git add -A | Everything, including deletions (more thorough than .) |
git add . does NOT stage deleted files. If you deleted files and want Git to record it, use git add -A instead.Alex's actual commit history so far, each one a single logical change:
a3f9b12 initial commit: add app.py, README and requirements 4341109 feat: add MongoDB database module and env template