ABSTRACT

A version control system like Git keeps track of changes to files so that we can recover old versions if we want to. Its heart is a way to archive files that records which versions of which files existed at the same time (so that we can go back to a consistent previous state), and stores any particular version of a file only once, so that we don't waste disk space. In this chapter we build a tool for doing both tasks. It doesn't do everything Git does---in particular, it won't let us create and merge branches---but it shows how we can use hashing, which is one of the most powerful and versatile ideas in programming.