git format-patch <base_branch_name>Typically you'll specify master, as you'll be executing this command from your feature branch.
It'll generate a file for each new commit.
Use the following (--stdout) to get all new commits into a single patch file:
git format-patch master --stdout > new-feature.patchThe patch can then be applied like so:
git checkout review-new-feature
cat new-feature.patch | git amor if you received multiple files:
cat *.patch | git amNow you can check the result:
git log --onelineNote: this gist is a shortened summary of this article