QuestenaՎարժանք, որը ցույց է տալիս՝ ինչ կրկնել հաջորդիվ
Հարց 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`Ճիշտ պատասխան
  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

Բացատրություն

`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.

Շարունակեք այս թեստով

Սկսել վարժանքը
Հարց 2: You run `git add app.py`, then edit app.py again, then run… · Git Fundamentals · Questena