tags:

views:

348

answers:

1

How to specify 'git send-email' to send mail on a specific patch?

I have 4 commits but I haven't done a 'git pull'. When I do 'git send-email', it will send out 4 emails (1 patch for each commit).

How can I configure git send-email so that it can send out email just for the last commit?

Thank you.

+1  A: 

git-send-email takes arguments specifying the patches to send. For example,

git send-email HEAD^

will create a patch for the last commit on your current branch. Similarly if you are formatting patches first with git-am, you can specify only the single patch file you want to send.

For more information on how to specify revisions, see man git-rev-list. The common methods you'll probably care about:

  • <commit1>..<commit2> means everything after up to
  • <commit>^ means the commit before <commit>
  • <commit>~5 means the commit five commits before <commit>
Jefromi
Thank you for your help.
n179911
Note that git-send-email accepting git-format-patch / git-rev-list parameters is quite new feature (require quite modern git)
Jakub Narębski
Ah, thanks, Jakub, didn't know that. I'm more of a push-pull guy. I imagine `git-format-patch` has been taking the `git-rev-list` parameters for a while, though, so there should be an alternate solution.
Jefromi