Most of the committing and pushing best practices are self-evident. One practice that might not be obvious is the importance of writing good commit messages. Descriptive commit messages can really help, especially after three months, when you are trying to figure out what prompted you to make a certain change, or in three years, when you inherit a repository from someone you cannot get in touch with.
The commonly stated best practices to adopt when committing code changes are as follows:
- Writing descriptive commit messages
- Committing often
- Committing related changes together
- Committing when a "unit of work" is done
- Testing the code before committing
- Running the full local test suite before pushing the commits to ...