Using diff and patch

Tutorial ButtonHaving trouble with the mission? Read how to get help.

Using diff and patch

The set-up

Through this training mission, imagine you are a big fan of
pancakes. Recently, you published a book with all your best
recipes.

The book has taken the global pancake community
by storm, and many of your adoring fans are creating and
sharing modifications to your recipes through “patch” files.

In this training mission, by playing different roles, you will
learn how to create and apply patches via the diff
and patch command-line tools.

Context in open source

For many open source development communities, patches are the
basis of how contributors describe and share changes. Projects
small and large often ask users to “submit a patch” with new
features or bugfixes. For example, for decades, the Linux kernel
project has asked contributors to send patch files to the main
project mailing list for discussion and integration into the
main project.

This mission consists of four parts: diffing individual files, patching individual files, diffing entire directory hierarchies, and patching entire directory hierarchies.