nerdexam
Microsoft

GH-900 · Question #43

You are working on a new project on your local machine called "Git and GitHub tutorial." You have created a folder for the project on your desktop and added a todo.txt file inside it. You now want…

The correct answer is A. Run git init inside the "Git and GitHub tutorial" folderright C. Run git config --global user.name "YourName" and git config --global user.email. To initialize Git tracking in a local folder, you must run 'git init' inside that folder - this creates a hidden .git directory that allows Git to start tracking changes (A). You also need to configure your identity with 'git config --global user.name' and 'git config --global…

Introduction to Git and GitHub

Question

You are working on a new project on your local machine called "Git and GitHub tutorial." You have created a folder for the project on your desktop and added a todo.txt file inside it. You now want Git to start tracking changes in this folder. What steps should you take to correctly initialize the Git repository and configure Git for this project? (Choose two.)

Options

  • ARun git init inside the "Git and GitHub tutorial" folderright
  • BCreate a GitHub repository before initializing Git locally
  • CRun git config --global user.name "YourName" and git config --global user.email
  • DUse git start to initialize the Git repository

How the community answered

(48 responses)
  • A
    94% (45)
  • B
    4% (2)
  • D
    2% (1)

Explanation

To initialize Git tracking in a local folder, you must run 'git init' inside that folder - this creates a hidden .git directory that allows Git to start tracking changes (A). You also need to configure your identity with 'git config --global user.name' and 'git config --global user.email' so that Git can associate commits with an author (C). Creating a GitHub repository first (B) is not required; local Git works independently of GitHub. 'git start' (D) is not a valid Git command.

Topics

#Git initialization#Git configuration#Local repository setup#git init command

Community Discussion

No community discussion yet for this question.

Full GH-900 Practice