Loading
Current section: Commands 17 exercises
lesson

Understanding Git Commit, Add, and Status

The git commit command is used to make a commit. Commits require a message, which is added with the -m flag.

It's a good practice to use present tense commit messages:


git commit -m "Add help, init, and status notes"

After the commit command finishes, it will show the branch, its ab

Loading lesson

Transcript

00:00 use git commit to make a commit commits require a message which we can use the dash m flag for i like to use present tense commit messages like add help init and status notes now instead of a

00:14 commit we actually got the status output here and that's because no files are staged to be committed we can fix that with git add dot which adds all those files and running our commit command again we see the branch it's abbreviated commit shaw and the message that we wrote three files were

00:32 changed with three insertions creating these three files and now when we run git status again we see that there's nothing to commit and we have a clean working tree