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 firstname.lastname@example.org 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 email@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 firstname.lastname@example.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 email@example.com /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 🙂