Pack, then post
A parcel: You put items in a box (staging), then seal and post it with a label (commit). Until it's sealed you can still swap things in and out.
Three places your work can be
- working tree — the files as they are on disk right now.
- staging area — changes you've chosen for the next commit (git add).
- History — commits saved for good (git commit).
git init
echo "<h1>Momo House</h1>" > index.html
echo "body { font-family: sans-serif; }" > style.css
git status
git add index.html
git status
git commit -m "Add home page"
git add style.css
git commit -m "Add basic styles"
git log --oneline- git add . stages everything that changed.
- Write messages in the present tense, saying what the commit does: "Add menu page", "Fix price typo".
- Small commits that each do one thing are easier to understand and undo.