Your First Repository
Four commands and you have a tracked project.
git init starts tracking this directory.
git status says what git currently believes.
git add file stages a change.
git commit -m "message" records it.
✦ status is the command to lean on
Run it before adding, after adding, and before committing. It is not a formality, it is the only command that tells you what git thinks AND what to do next. Almost every confusing git situation is one where somebody stopped checking status and started guessing.
Reading the status output. Files fall into groups, and the group is the whole message.
Untracked means git has never seen this file.
Changes to be committed means staged and ready.
Changes not staged for commit means edited since the last commit, but not yet staged.
When you are confused about what git is doing, you are almost always confused about which of these a file is in.
Mark this lesson complete
Signed in, your progress follows you to every device.