Earlier today, I was looking for some basic instructions on using
git-format-patch with
mutt. It turns out to be really easy.
$ git branch
* log-decorate
master
$ git format-patch origin
0001-Document-git-log-decorate.patch
$ mutt -H 0001-Document-git-log-decorate.patch
Then enter the
To:
address, accept the
Subject:
, add any touch ups, and send. When mutt's finished, it'll exit.
Receiving and applying patches through mutt is pretty easy also. Using mutt trickiness, these steps can be automated, but here's the basic process:
- Find the email with the patch you want to apply
- Press
s
(or whatever save-message is bound to) - Enter a path where you want to save the message
- Repeat steps 1-3 (entering the same path) to save additional patches in a mailbox
- Apply the patches while in your working tree:
git am /path/to/patch-mailbox
Each patch is applied as a single commit. Read the documentation for
git cherry to determine which of your patches have been applied upstream.