๐ŸŽ‰ Special Offer !    Code: GET300OFF    Flat โ‚น300 OFF on every Java Course
Grab Deal ๐Ÿš€

Create New Repository - git init


Introduction

  • git init is a command used to create and initialize a new Git repository in a folder.
  • It creates a hidden .git folder in your directory, where Git stores all its tracking information.
    • This hidden .git folder contains all the configuration and metadata for tracking changes (like HEAD, branches etc.).
  • It marks the start of version control, allowing you to track changes, commit updates, and manage versions of your files.
  • It turns a regular folder into a Git repository, ready for version control.

How to use git init ?

  1. Open the Git terminal (or command prompt) and navigate to the project folder:
    cd path/to/our/folder
    Open Git Bash
  2. Run the git init command:
    git init
    Git init Command
  3. Git will create a hidden .git folder inside the project, indicating that it is now a Git repository.