312-97 practice question 5 of 35

(Walter O’Brien recently joined as a junior DevSecOps engineer in an IT company located in Lansing, Michigan. His organization develops robotic…

Full set: 100 questions
(Walter O’Brien recently joined as a junior DevSecOps engineer in an IT company located in Lansing, Michigan. His organization develops robotic process automation software for various clients stretched across the globe. Walter’s team leader asked him to configure username and user email for git in VS Code. Therefore, he opened Visual Studio Code IDE console, then clicked on Terminal tab and selected New terminal. Which of the following command should Walter execute in the terminal to configure username and user email for git in VS Code?)
Answer options
A: get config --global user-name “walter username for git” get config -–global user-email “walter email address used for git”.
B: get config --global user.name “walter username for git” get config –global user.email “walter email address used for git”. Correct answer
C: get git config --global user.name “walter username for git” get git config –global user.email “walter email address used for git”.
D: get config --global user_name “walter username for git” get config -–global user_email “walter email address used for git”.
Correct Answer:
B. get config --global user.name “walter username for git” get config –global user.email “walter email address used for git”.
Explanation

The correct command to configure Git settings is git config. The question's options contain a typo, using get instead of git. Assuming this typo, option B provides the correct keys for setting the user's name and email: user.name and user.email. The --global flag ensures this configuration applies to all repositories for the current user on the system. This is a one-time setup command typically run after installing Git.

Why Incorrect

A. The command get is incorrect, and the key user-name (with a hyphen) is not the valid configuration key for the username.
C. The command get git config is syntactically incorrect. The correct command is simply git config.
D. The command get is incorrect, and the keys username and useremail (with underscores) are not the valid configuration keys.

References

1. Chacon, S., & Straub, B. (2014). Pro Git (2nd ed.). Apress. Chapter 1.6, Getting Started - First-Time Git Setup. The documentation explicitly states the commands are git config --global user.name "John Doe" and git config --global user.email [email protected].

2. Git Documentation. (n.d.). git-config Documentation. git-scm.com. Retrieved from https://git-scm.com/docs/git-config. The official documentation lists user.name and user.email as the correct configuration variables.

Scroll to Top