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

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

I have 4 commits, but I did not do "git pull". When I do "git send-email", it will send 4 letters (1 patch for each commit).

How to configure git send-email so that it can send email only for the last commit?

Thanks.

+6
git
source share
2 answers

git-send-email accepts arguments indicating the patches to send. For example,

 git send-email HEAD^ 

will create a patch for the last commit in your current branch. Similarly, if you format patches first with git-am , you can specify only one patch file that you want to send.

For details on how to indicate changes, see man git-rev-list . Common methods that you probably care about:

  • <commit1>..<commit2> means everything after
  • <commit>^ means commit before <commit>
  • <commit>~5 means committing five commits to <commit>
+5
source share

IMHO this will work:

 git send-email -1 
+1
source share

All Articles