Creating a new repository

Next, create a directory, named hobnob, to house our project. Then, navigate inside and run git init. This will allow Git to start tracking changes to our project; a project tracked by Git is also known as a repository:

$ mkdir -p ~/projects/hobnob$ cd ~/projects/hobnob/$ git initInitialised empty Git repository in ~/projects/hobnob/.git/
As we introduce new Git commands, I encourage you to read their full documentation, which you can find at https://git-scm.com/docs.

Running git init creates a .git directory, which holds all version-control-related information about the project. When we interact with Git using its CLI, all it's doing is manipulating the content of this .git directory. We usually don't have to care ...

Get Building Enterprise JavaScript Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.