git init
Initializes a new Git repository in the current directory.
Syntax
git init [<directory>]
Options
- directory: Optional. Creates a new directory and initializes a repository inside it
- --bare: Creates a bare repository (no working directory)
- --initial-branch <name>: Sets the name for the initial branch
Example
git init my-project
Tip
Use --bare for server-side repositories that only receive pushes.