Once you have worked on your code, you'll want to check your changes into your local repository. This is the first step in propagating your change further, as you need to update your local copy of the repository before you can push the changes for other users to view.
This recipe will tell you how to commit changes to your local Git repository.
Let's make changes into our local Git repository:
Change the directory into the one you want to use for your project.
Add any new files to the
git
staging area:git add .
Commit the new files and changes to the repository:
git commit -am "An interesting and illuminating check in message"
The 'a'
option means 'all
'; this essentially means that you are committing all changes in this commit, and the m
option means 'message
', and allows you to add a message explaining your commit.
The preceding commands carry out two different tasks: the first adds new files to the change set, and the second adds any changes to the change set; it also commits them with an appropriate message. The changes exist within the Git staging area until you commit them. The best way to think of the staging area is as a buffer between the codebase and your changes. You can chuck away your Git stage at any point without affecting the branch you are currently working on.
You can find more details on how to changes into Git at https://git-scm.com/docs/git-add.