DEV Community

Discussion on: What does it mean to commit responsibly?

Collapse
 
joshcheek profile image
Josh Cheek

A lot of these (the ones about the quality) I don't think are important in each commit, just so long as they're in place by the time you want to merge it into trunk/master.

For me, committing responsibly means you do git status to see what things have changed, you predict what you're going to see in the first file, you do git diff firstfile to make sure the change you see in that file is the change you expected to see. If you see something you need to change, you make the change and start again. If not, you git add firstfile to add it, and then you start over at git status, until you have the staging area built up to be the commit you want. This will make sure you know what you're committing (eg I've seen people accidentally commit random files, once it was even our private keys). This review will also help you write a good commit message.

Also, commit messages should be in present tense. It keeps them shorter and easier to understand.