Creating patches from branches
Instead of counting the number of commits you need to make patches for, you can create patches by specifying the target branch when running the format-patch
command.
Getting ready
We'll use the same repository as in the previous example:
$ git clone https://github.com/PacktPublishing/Git-Version-Control-Cookbook-Second-Edition_offline-sharing.git $ cd Git-Version-Control-Cookbook-Second-Edition_offline-sharing
Make sure we have the develop
 branch checked out:
$ git checkout develop
How to do it...
We'll pretend that we have been working on the develop
branch and have made some commits. Now, we need to format patches for all those commits so that we can send them to the repository maintainer or carry them to another machine.
Let's see the commits on develop
, not on master
:
$ git log --oneline master..develop 583225a (HEAD -> develop) Adds functionality to prime-test a range of numbers f6c5713 Adds Makefile for easy building d00ffc0 Move print functionality of is_prime...