Skip to content

Help us create more tutorials! Make a donation using the Donate button or become a member using the button below to hide this banner and track your progress.

Commit files – Git

Summary

To commit your staged files using Git, enter the following command in your terminal:

git commit -m "Your commit message"

Details

Replace “Your commit message” with what you want your message to be. The message should summarize what has changed and be succinct.

To check to see if the commit was successful, enter the following command in your terminal:

git log

Exercises

Run the command from the Summary to commit your changes. Use git log to check the commit.

References

Recording Changes to the Repository from the Pro Git book (see the section called “Initializing a Repository in an Existing Directory”)

Viewing the Commit History from the Pro Git book

Back to: Git Course > Git Basic Workflow