When I decided to actually send one patch to a project's mailing list, I found it natural to attempting it the git's way, which is by using the
git send-email
command.Now, it turned out I had to overcome some hurdles to be actually able to send the email from my Fedora 10, using Gmail as the outgoing SMTP server.
First problem, if you previously installed git with
yum install git
that does not include the send-email command; fix this with yum install git-email
.Then, add the correct configuration variables with the following:
$ git config --global sendemail.smtpserver smtp.gmail.com
$ git config --global sendemail.smtpserverport 587
$ git config --global sendemail.smtpencryption tls
$ git config --global sendemail.smtpuser your_email@gmail.com
Now it's ready: the command
git send-email patch-name
will ask you for some info about the email sender (you can change the From: field) and recipient, your Gmail password and then it will send the email.Optionally, it is possible to skip the password prompt by adding it to the configuration with:
$ git config --global sendemail.smtppass your_password
Lastly, I found a packaging bug so that git-email does not pull some perl libraries required for this to work, so I had to manually install perl-Authen-SASL (
yum install perl-Authen-SASL
).UPDATE: The packaging bug is now fixed, and the commands were updated to also work Fedora 11.
This was handy, thanks - you might want to update commands though, as new version of git 1.6.2.5 (F11) moves all git subcommands to be separate, as in 'git config' rather than 'git-config'
ReplyDeleteThanks for the notice!
ReplyDeleteWorks like a charm, thanks a lot!
ReplyDeleteThank you very much, this article really helped me!
ReplyDeleteThe same packaging bug I have found in my OpenSUSE, by the way.
simple and usefull! thanks!
ReplyDeleteThanks for the post. It is very handy for quick reference, but particularly for explaining this to somebody else.
ReplyDeleteSame problem and solution for debian/squeeze
ReplyDeletesudo apt-get install git-email
cpan Authen::SASL
how do i access this via a proxy ?
ReplyDeleteI can reach smtp.gmail.com/587 but only by staying behind a proxy.
You saved me a lot of time!
ReplyDeleteThank you!
My kudos also for this writeup!
ReplyDeleteI got the following error on my ubuntu (and expect the same on debian linux):
Can't locate Net/SMTP/SSL.pm ...
Fixed with:
sudo apt-get install libnet-smtp-ssl-perl
Thanks this helped a lot. :)
ReplyDelete