Questenaتدريب يوضح لك ما ينبغي مراجعته لاحقًا
السؤال 1

In Git, what does the command `git add <file>` do?

  1. Commits the file's current content directly to the repository history
  2. Marks the file to be tracked but stores no content snapshot until the commit itself runs
  3. Records the file's current content in the index, to be included in the next commitالإجابة الصحيحة
  4. Uploads the file to the configured remote repository

الشرح

`git add` copies the file's content, as it is at that moment, into the index (staging area); the next `git commit` records what is in the index. The tempting distractor is 'marks the file to be tracked but stores no content': `git add` does start tracking new files, but it also stores an actual snapshot of the content immediately — which is why edits made after `git add` are not staged.

تابع هذا الاختبار

بدء التدريب
السؤال 1: In Git, what does the command `git add <file>` do? · Git Fundamentals · Questena