The core of Git is to organize changes into logical chunks. So knowing how to make an actual commit matters, and there are many tricks around it.

First, know the difference between untracked and unstaged.

git add #

git add is the base command to choose what files to include in a commit. But it's not enough on its own.

Use git add . to include all untracked and unstaged changes in the next commit.

If you need to be more precise use git add --patch or git add -p to go through each "hunk" of changes. You'll decide what to do with each hunk using these commands:

git commit #

Once you've decided what files to include a commit, you still need to make the commit itself. The basic form for this command is git commit.

However, you should always include a message with your commit. This is just good practice, as messages help you recognize a commit and its changes. You can do this with git commit -m, followed by a message string in quotes.

git commit -m  "Update the color scheme to something with more pop"

Some other useful options for this command are:

There's other ways to add and work with one's Git commits, but those are for another post.