Commit it
Learn
Snapshot it: git commit
git commit -m "message" records everything staged as a permanent snapshot, with your
message describing why. A good message is short and specific: "Add README", "Fix login
timeout", not "stuff".
git log --oneline shows the history, one commit per line: a short hash (the
commit's ID) and its message.
git commit -m "Describe the change"
git log --oneline
Your task
Commit the staged file with the message Add README, then run git log --oneline to see your first commit in the history.
Interview prep
The init → add → commit loop is the most basic thing every engineer is expected to know cold.
What's the difference between git add and git commit?
git add stages a change — it moves it into the index (the staging area), the set of changes that will go into the next snapshot. git commit records everything currently staged as a permanent commit in the history. The two-step design lets you choose exactly which changes belong in a commit rather than committing everything at once.