QuestenaPractice that shows what to review next
Question 2

You run `git add app.py`, then edit app.py again, then run `git commit` with no extra flags and no second `git add`. Which version of app.py is recorded in the commit?

  1. The version as it was at the moment you ran `git add`Correct answer
  2. The latest version in your working tree at commit time
  3. Both versions, recorded as two separate entries in the commit
  4. Neither — Git aborts the commit because the file changed after staging

Explanation

`git commit` records the state of the index, not the working tree. The file goes into the commit exactly as it was when last staged; the later edits remain only in the working tree as an unstaged change. Git does not abort — it happily commits the staged snapshot and leaves the file listed as modified afterwards.

Continue with this test

Start practice
Question 2: You run `git add app.py`, then edit app.py again, then run… · Git Fundamentals · Questena