Commit to Version Control

Changes are bundled together into one singular checkpoint, called a commit. Before committing, we add them to a staging area where we can represent all changes into the commit.

To add a single file to the staging area, execute the following command.

git add name-of-file

When all changed files are added to the staging area, we are ready to commit the files. Commits require a message, describing the nature of the change.

git commit -m "write message here"

Git Status

Before moving on to sync our changes, let's validate that you committed your change. You can run git status again, which should tell you that there are no uncommitted changes. You can also run git log to show the history of commits, which should display the most recent commit information.