nerdexam
Microsoft

AZ-400 · Question #235

Drag and Drop Question You manage the Git repository for a large enterprise application. During the development of the application, you use a file named Config.json. You need to prevent Config.json fr

The correct answer is Add Config.json to the .gitignore file.; Run the git add .gitignore command.; Run the git commit command.. To prevent Config.json from being tracked by Git, you must first add the filename to the .gitignore file, which tells Git to ignore that file going forward. Next, you stage the .gitignore file itself using 'git add .gitignore' so Git tracks the ignore rules, and finally you run '

Submitted by saadiq_pk· Mar 6, 2026Configure and manage source control - specifically configuring Git repositories to exclude files from version tracking using .gitignore, which is a core competency in the AZ-400 (DevOps Engineer Expert) certification under 'Design and Implement Source Control Strategies'.

Question

Drag and Drop Question You manage the Git repository for a large enterprise application. During the development of the application, you use a file named Config.json. You need to prevent Config.json from being committed to the source control whenever changes to the application are committed. Which three actions should you perform in sequence? To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order. Answer:

Exhibits

AZ-400 question #235 exhibit 1
AZ-400 question #235 exhibit 2

Answer Area

Drag items

Delete and recreate the repository.Run the git reflog expire command.Run the git add .gitignore command.Add Config.json to the .gitignore file.Run the git commit command.

Correct arrangement

  • Add Config.json to the .gitignore file.
  • Run the git add .gitignore command.
  • Run the git commit command.

Explanation

To prevent Config.json from being tracked by Git, you must first add the filename to the .gitignore file, which tells Git to ignore that file going forward. Next, you stage the .gitignore file itself using 'git add .gitignore' so Git tracks the ignore rules, and finally you run 'git commit' to save the .gitignore changes to the repository. This three-step sequence is the standard Git workflow for establishing ignore rules without disrupting the existing repository.

Topics

#Git#Source Control#.gitignore#Azure DevOps

Community Discussion

No community discussion yet for this question.

Full AZ-400 Practice