nerdexam
Microsoft

GH-900 · Question #4

What are three valid states for a file in a git repository? (Choose three.)

The correct answer is A. Committed B. Modified D. Staged. In a Git repository, a file can be in one of the following three valid states: Committed: The file is saved in the local repository. It is part of the permanent history of the Modified: The file has been changed but not yet staged or committed. It is in the working Staged: The…

Introduction to Git and GitHub

Question

What are three valid states for a file in a git repository? (Choose three.)

Options

  • ACommitted
  • BModified
  • CUncommitted
  • DStaged
  • ETracked

How the community answered

(49 responses)
  • A
    90% (44)
  • C
    6% (3)
  • E
    4% (2)

Explanation

In a Git repository, a file can be in one of the following three valid states: Committed: The file is saved in the local repository. It is part of the permanent history of the Modified: The file has been changed but not yet staged or committed. It is in the working Staged: The file has been marked to be included in the next commit. It is in the staging area, ready to be committed. These states represent the typical lifecycle of a file as it moves through the process of being edited, reviewed, and saved in Git.

Topics

#Git file states#Git workflow#Staging area#Commits

Community Discussion

No community discussion yet for this question.

Full GH-900 Practice