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.