The command git commit -m "commit message>" can be used to add a commit. The -m specifies that we will include a message; keep in mind, though, that commit messages are restricted to 50 characters.
An initial commit is the first commit made in a Git project, aside from the name of this website. Developers use Git to build chains of commits that monitor a project's revision history, as indicated in the previous section.
The command git commit will not work if no files are added. To figure out what to commit, Git only looks at the staging area. Staging, or adding, files can be done using the command line and most Git interfaces, such as GitHub Desktop, by selecting the lines or files you want to stage.
To see a list of files committed, type git show —name-only HEAD # or simply use HEAD: git show —name-only HEAD #.
Pushing and pulling a few times a day is usually enough. More frequent pushes, like @earlonrails mentioned, means less chance of conflicting changes, but this isn't usually a significant concern. Consider it this way: when you commit to your local repository, you're basically declaring, "I believe in this code." It's finished.