Skip to main content

Making a New Local Repository

Making a new Git repository means just making an empty timeline with nothing it in, including not initial version. After you create the new local repository, it's usually considered a good idea to take any files you already have, stage all of them, and commit them with a comment like "Initial Commit."

To make a new local repository, go to the root folder of your project (the top-most folder), and run the following command:

git init --initial-branch main

To explain:

  • init means to create a new repository (to initialize)
  • --initial-branch main means that the primary branch of the project should be called main. If using older versions of Git, not including this means that the initial branch will be called "master" instead. A change from the term master was made because it originates, in part, from uncritically using master/slave terminology in computing, which itself was an insanely racist name more than likely drawn from american chattel slavery. I'm pretty sure Git has defaulted to "main" for a long time but I'm paranoid.