Skip to content

Try our new Crash Courses!

Buy one of our new Crash Courses, now hosted on Teachable.

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 Reference > Git Basic Workflow