I am trying to create a git patch from multiple commits in my branch. However, I need to create it from arbitrary commits (they wont necessarily be in a range). In between the commits I want to create a patch out of, some of the commits change some of the files in the patch may have also been changed.
Here is my use case (assume greater number = later commit date):
develop HEAD
Commit 5 - Changed a.txt
Commit 4 - Changed a.txt, b.txt, c.txt
Commit 3 - Changed b.txt, c.txt
Commit 2 - Changed a.txt
Commit 1 - Changed a.txt, b.txt, c.txt, d.txt
master HEAD
Now I want to be able to create a patch for commits 1, 3 and 5 from the develop branch and apply them to the master branch.
I've looked around and all I can find is the ability to create a patch in a range. Is there a way to create a patch for multiple commits with potential changes in the files between them?