nerdexam
Cisco

200-901 · Question #267

A file that already exists in a local repository is updated. Which command must be executed to ensure that the changes in the file are included in the next Git commit?

The correct answer is C. git add. git add stages file changes so they are included in the next commit. Even for files already tracked by Git, modifications must be explicitly staged with git add <filename> (or git add .) before running git commit. Without this step, the changes remain in the working directory…

Software Development and Design

Question

A file that already exists in a local repository is updated. Which command must be executed to ensure that the changes in the file are included in the next Git commit?

Options

  • Agit update
  • Bgit merge
  • Cgit add
  • Dgit rebase

How the community answered

(52 responses)
  • A
    2% (1)
  • B
    6% (3)
  • C
    88% (46)
  • D
    4% (2)

Explanation

git add stages file changes so they are included in the next commit. Even for files already tracked by Git, modifications must be explicitly staged with git add <filename> (or git add .) before running git commit. Without this step, the changes remain in the working directory but are not committed. git update is not a valid Git command. git merge integrates branches, not individual file changes. git rebase replays commits onto another base branch - it does not stage files.

Topics

#Git#Version Control#Staging Changes

Community Discussion

No community discussion yet for this question.

Full 200-901 Practice