Your first commit
Objective: Creating your first commit and pushing it into your repository.
So what are commits and how do they work ? Well, our repository is a space where we can keep lots of things (your code, your files, and each file’s revision history).
But how do you access this space ? Well, this is where our commit comes in. Commits allow us to add things to the repository, change them, or even delete when necessary.
Here is how it works:
First you are going to want to pull your project into Git Bash by typing:
git pull origin main
Now we check if there is anything new added to our project. We do this by typing:
git status

Now, if I want to add my commit, I’d type:
git add Assets/Scenes/SampleScene.unity
This would add the specific file that I mentioned. If I wanted to add all changes made, I could simply type:
git add .

When I check the status again by typing git status it will show me what has been committed and is now ready to push.

You can see that it is staged to be added to the repository and it is now in green. I now want to commit modification, and give it a description by typing:
git commit -m “”
Between your quotation you can add the description for your commit.

This allowed us to access our space, now we just need to push our changes into it. We can do that by typing:
git push origin main

You can check on GitHub, in your repository, and it will have the new commit added to the top of the list of commits you have made.