Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

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.

like image 248
n179911 Avatar asked Aug 05 '09 18:08

n179911


2 Answers

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>
like image 140
Cascabel Avatar answered Nov 06 '22 22:11

Cascabel


The question was asking about a "specific patch", so many may come here to find how to send email for a spefic commit, everywhere in the log history. For this case answer may be:

git send-email -1 b7ed62c8d882fecaf70da813a0494b2f8265d544 -to [email protected]

Where b7ed62c8d882fecaf70da813a0494b2f8265d544 is the commit i want o send as a single [PATCH] whatever is his position in the log history.

like image 39
Angelo Dureghello Avatar answered Nov 06 '22 23:11

Angelo Dureghello