nerdexam
CompTIA

XK0-005 · Question #1634

An administrator created an initial Git repository and uploaded the first files. The administrator sees the following when listing the repository: The administrator notices the file .DS.STORE should…

The correct answer is D. echo .DS_STORE >> .gitignore. The administrator should run "echo .DS STORE >> .gitignore" from the root of the local repository before the next commit to ensure the file is not uploaded again in future commits. This command will append the file name .DS STORE to the end of the .gitignore file, which is a…

System Management

Question

An administrator created an initial Git repository and uploaded the first files. The administrator sees the following when listing the repository: The administrator notices the file .DS.STORE should not be included and deletes it from the online repository. Which of the following should the administrator run from the root of the local repository before the next commit to ensure the file is not uploaded again in future commits?

Exhibit

XK0-005 question #1634 exhibit

Options

  • Arm -f .DS STORE && git push
  • Bgit fetch && git checkout .DS_STORE
  • Crm -f .DS_STORE && git rebase origin main
  • Decho .DS_STORE >> .gitignore

How the community answered

(24 responses)
  • A
    8% (2)
  • B
    4% (1)
  • C
    4% (1)
  • D
    83% (20)

Explanation

The administrator should run "echo .DS STORE >> .gitignore" from the root of the local repository before the next commit to ensure the file is not uploaded again in future commits. This command will append the file name .DS STORE to the end of the .gitignore file, which is a special file that tells Git to ignore certain files or directories that should not be tracked or uploaded to the repository. By adding .DS STORE to the .gitignore file, the administrator will prevent Git from staging, committing, or pushing this file in the future.

Topics

#Git#Version Control#.gitignore#File Management

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice