sudo apt install git-email
or what have you.
git config --global sendemail.from "YOUR NAME <your@email.org>"
git config --global sendemail.smtpserver out.email.org
git config --global sendemail.smtpuser your@email.org
If you have different accounts for different projects, you can do the same as above but like:
git config --global sendemail.PROJECT_NAME.to "project@project.org"
git config --global sendemail.PROJECT_NAME.from "YOUR NAME <your@email.org>"
etc.
Prevent Git from adding yourself to the Cc: field:
git config --global sendemail.suppresscc self
This is useful if you are sending the patch to a mailing list and are therefore going to receive a copy of the email anyway.
Clone the repo, edit and commit normally. Then, instead of pushing, send the patch via email:
git send-email --dry-run --to project@project.org -1
(-1
is "all the changes up to the last commit")
Once the email is sent, there's no going back, so using --dry-run
is recommended. Check that everything is correct, especially that no unwanted Cc: are being added by Git. If everything looks fine, run the command again without --dry-run
to actually send the mail.