Chapter 12. Creating a clean history
This chapter covers
- Writing a good commit message
- Building a commit using only certain changes in a file
- Building a commit using a graphical application
- Avoiding committing bad whitespace
You saw in technique 4 that a clean history can make it easier to find useful information. For a history to be clean, it should use good, well-formatted commit messages for commits that are as small as possible. In this chapter, you’ll learn how to create a clean history.
Technique 4 explained why small commits are better and how commit messages should be formatted. Let’s go into more detail about what makes a good format when writing commit messages, and why.
The following listing shows an example of a good commit-message format. It’s strongly influenced by a guide written by Tim Pope, which is now at http://mng.bz/hMe2.