How do you initialize a new Git repository?

How do you initialize a new Git repository?

a) git init
b) git start
c) git new
d) git create

Answer:

a) git init

Explanation:

The git init command initializes a new Git repository in the current directory. It creates a hidden .git folder that contains all the metadata and version control history for the project.

This is the first step when starting a new project with Git, as it allows you to begin tracking changes and commits in your project.

Once a repository is initialized, you can start adding files and making commits to track your project history.

Reference:

Top 100 Git and GitHub MCQ Questions and Answers

Scroll to Top