Creating patches

In this recipe, we'll learn how to make patches out of commits. Patches can be sent via e-mails for quick sharing or copied to sneakernet devices (USB sticks, memory cards, external hard disk drives, and so on) if they need to be applied on an offline computer or the like. Patches can be useful methods to review code as the reviewer can apply the patch on his repository, investigate the diff, and check the program. If the reviewer decides the patch is good, he can publish (push) it to a public repository, given the reviewer is the maintainer of the repository. If the reviewer rejects the patch, he can simply reset his branch to the original state and inform the author of the patch that more work is needed before the patch can ...

Get Git: Mastering Version Control now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.