How to initialize git?
Initializing Git is creating a new Git repository in the project folder.
Basic method (most common)
- Open the terminal
- Navigate to the project folder:
bash
cd path/to/project- Run the command:
bash
git initAfter this:
- a hidden
.git/directory appears in the folder - the project becomes a Git repository
- Git starts tracking file changes
Short Answer
Interview readyPremium
A concise answer to help you respond confidently on this topic during an interview.