How to create (initialize) a local Git Repository

To create (initialize) a loca Git repository for a project, go to the root of your project and run this command:

git init

That’s it!

Now you can start tracking and commiting files:

  • Run git add . to stage your files.
  • Run git commit -m 'Describe your changes' to add a descriptive message about your file changes.
  • Run git push origin master to push your changes to your remote repository.

To push your files to a remote repository, you need to set up a remote repo somewhere, for example on GitHub.

How to completely remove Git from a project.

Has this been helpful to you?

You can support my work by sharing this article with others, or perhaps buy me a cup of coffee 😊


Share & Discuss on