To start your first git project, follow these steps:
- Create a new directory on your computer to hold the project files.
- Open a terminal window and navigate to the project directory.
- Initialize the git repository by running the following command:
- Add the project files to the git repository by running the following command:
git add .
- Commit the project files to the git repository by running the following command:
git commit -m "Initial commit"
- (Optional) If you want to push the project to a remote git repository (e.g. on GitHub), run the following commands to add the remote repository and push the project files:
git remote add origin [remote_repository_url] git push -u origin master
Replace [remote_repository_url] with the URL of the remote repository.
This will create a new git repository for your project, add the project files, and commit them to the repository. If you have added a remote repository, the project files will also be pushed to the remote repository.