GITHUB-FOUNDATIONS practice question 15 of 15
What are three valid states for a file in a git repository? (Each correct answer presents part of the solution. Choose three.)
Full set: 75 questionsGit recognizes three primary states for any file in a repository lifecycle.
1. Modified – the file has been changed in the working directory but those changes are not yet staged.
2. Staged – the changed file has been added to the index and will become part of the next commit.
3. Committed – the file’s current snapshot has been safely recorded in the local repository history. These three states are explicitly identified in Git’s official documentation and form the core of its change-tracking model.
C. Uncommitted – Not an official Git state; simply an informal English description of “not yet committed.”
E. Tracked – Describes whether Git follows a file (tracked vs. untracked); not counted among the three file states (modified, staged, committed).
1. Chacon, S., Straub, B. “Pro Git,” 2nd ed., Apress, 2014, Chapter 1.2 “The Three States,” 1st–3rd paragraphs. https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository
2. Git Community Docs, “git-add(1) Manual,” SYNOPSIS & DESCRIPTION sections: clarifies moving files to “staged” state. https://git-scm.com/docs/git-add
3. Git Community Docs, “git-commit(1) Manual,” DESCRIPTION section: defines “committed” objects stored in repository history. https://git-scm.com/docs/git-commit
Keep practicing
Take the free GITHUB-FOUNDATIONS practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other GITHUB-FOUNDATIONS practice questions
- Question 1What are the defining features of Git?
- Question 2Which of the following two-factor authentication (2FA) methods can you use to secure a Gi…
- Question 3Which of the following are advantages of saved replies? (Each correct answer presents par…
- Question 4Which of the following can be performed within GitHub Desktop?
- Question 5Which of the following best describes cloning a repository?
- Question 6What should be done to locate an existing action that was provided by a GitHub-approved v…
