<a href="git-howto.html#toc-Preparing-a-patchset">2.10 Preparing a patchset</a></h2>

<div class="example">
<pre class="example">git format-patch &lt;commit&gt; [-o directory]
</pre></div>

<p>will generate a set of patches for each commit between <var>&lt;commit&gt;</var> and
current <var>HEAD</var>. E.g.
</p>
<div class="example">
<pre class="example">git format-patch origin/master
</pre></div>

<p>will generate patches for all commits on current branch which are not
present in upstream.
A useful shortcut