# to generate a patch between two commits git diff commitid1 commitid2 > my_awesome_change.patch # to generate a patch between the HEAD and a specific commits git diff commitid1 > my_awesome_change.patch
Here is what the above code is Doing:
1. git diff: Generates a diff between two commits.
2. commitid1: The commit to start the diff from.
3. commitid2: The commit to end the diff at.
4. my_awesome_change.patch: The file to save the diff to.