if you work on a project like the Linux kernel, rather than make a pull request you will need to submit your commits to a listserv for review.This entry details how to use git-send email with Gmail.

Then on the web: Go to Google -> My Account -> Connected Apps & Sites -> Allow less secure apps -> Switch ON

To create a patch set:

git format-patch HEAD~~~~ --subject-prefix="PATCH "

Then send the patches to a listserv:

git send-email --annotate --to project-developers-list@listserve.example.com 00*.patch

To create and send updated version (version 2 in this example) of the patch:

git format-patch -v 2 HEAD~~~~ ……
git send-email --to project-developers-list@listserve.example.com v2-00*.patch


Sending patches by mail

Suppose you’ve got a lot of commit against a project (here ulogd2, official branch is git-svn) and that you wan to send your patchset to the Mailling list devel@netfilter.org.To do so, just open a shell at the root of the git directory and use:

git format-patch --stat -p --raw --signoff --subject-prefix="ULOGD PATCH" -o /tmp/ulogd2/ -n gitsvn
git send-email --compose --no-chain-reply-to --to devel@netfilter.org /tmp/ulogd2/

First command will create a serie of mail from patches in /tmp/ulogd2/ with statistic report and second will start your editor to compose an introduction mail to the patchset.

To avoid awful threaded mail series, one can use :

git config sendemail.chainreplyto false

Applying patches from mail

Just save mail to an mbox and run:

git apply-mbox MBOX

Please note that it will apply the modification it the patch apply without any warning (or hunk).

To apply the patch even if there is some hunks, just run:

git apply-mbox -m MBOX

To transfer patches from a repository to another, one could use git-format-patch on system with modification followed by git-am on target repository.

If you like this post, don’t forget to share 🙂

This article is written by our awesome writer
Comments to: How to Using git send-email with Gmail

Your email address will not be published. Required fields are marked *

Attach images - Only PNG, JPG, JPEG and GIF are supported.

New Dark Mode Is Here

Sign In to access the new Dark Mode reading option.

Join our Newsletter

Get our monthly recap with the latest news, articles and resources.

By subscribing you agree to our Privacy Policy.

Latest Articles

Explore Tutorials By Categories


Codeverb is simply an all in one interactive learning portal, we regularly add new topics and keep improving the existing ones, if you have any suggestions, questions, bugs issue or any other queries you can simply reach us via the contact page


Welcome to Codeverb

Ready to learn something new?
Join Codeverb!

Read Smart, Save Time
    Strength indicator
    Log In | Lost Password