git init creates a Git repository in the directory where you run it, allowing Git to manage that project's changes. The repository is initially local, and Git does not track files until you add and commit them. section 2.3.1 section 2.3.6
Initialize two web-app projects
Run the command from each project directory: cd ~/Dev/roadtok8s/py/ followed by git init, then cd ~/Dev/roadtok8s/js/ followed by git init. Git reports that it initialized an empty repository. Check whether a directory is already a repository with git status; running git init there reinitializes the existing repository instead. section 2.3.1
A typical setup continues after initialization:
- Create a .gitignore file for files Git should ignore. section 2.3.4
- Run git add to select files, then git commit -m "Commit message" to record them. section 2.3.4
- Add a remote and push when the repository should be hosted elsewhere. section 2.4.3
Listing 2.23 Using git init to initialize a Git repository
cd ~/Dev/roadtok8s/py/ git init
Shows the minimal command sequence for initializing the Python project; the equivalent Node.js listing is also available. section 2.3.1
For a server-side remote repository, git init --bare creates a repository without a working directory; the setup also assigns HEAD to the main branch. section 3.3.2

