From the course: Complete Guide to Git

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Create formatted patches

Create formatted patches - Git Tutorial

From the course: Complete Guide to Git

Create formatted patches

- [Instructor] In this movie, we will learn to create formatted patches. Formatted patches are exports of commits in the Unix mailbox format. Why the Unix mailbox format? Because it's useful for email distribution of changes. In some setups, every commit is automatically emailed out to a list of subscribers so that they can view the changes and apply them. This was more common in the days before hosted repositories like GitHub existed. A formatted patch includes changes like a diff patch, but it also includes the commit messages and some of the commit's metadata. It will put each commit in a separate file by default. We can create a formatted patch with git format-patch and then a range of commits, just like we did when we were working with diff. If we omit the second value, it uses the current head. To create a formatted patch for a single commit, you would use the -1 option. If we are creating mini files, we probably want to put them somewhere besides in our current directory…

Contents