Jump to content

Configuring git send-email: Difference between revisions

From RTIME
Created page with "Sending patches via email can be greatly simplified by using '''git send-email''' command. For general usage and overview, look at e.g. [https://www.freedesktop.org/wiki/Softw..."
 
No edit summary
Line 2: Line 2:


To configure git to send email you have several options:
To configure git to send email you have several options:
#  Use your private email account. For gmail, this is documented in [https://git-scm.com/docs/git-send-email#_use_gmail_as_the_smtp_server git send-email man page].
#  Use your private email account. For gmail, this is documented in the [https://git-scm.com/docs/git-send-email#_use_gmail_as_the_smtp_server git send-email man page].
# Use CVUT mail server. The drawback of this approach is that it runs MS Exchange, which rewrites the outgoing emails in various ways (at least the ''From'' name and address), so the resulting email is different from what git sends.
# Use CVUT mail server as shown below.
 
 


==== Configuring CVUT mail server ====
==== Configuring CVUT mail server ====
Line 14: Line 12:
git config --global sendemail.smtpEncryption tls
git config --global sendemail.smtpEncryption tls
git config --global sendemail.smtpUser sojkam1@cvut.cz
git config --global sendemail.smtpUser sojkam1@cvut.cz
</pre>
Of course, replace ''sojkam1'' with your login name.
==== Remembering a password ====
Above shown configurations will ask you for a password every time you will send something. This is annoying. Luckily, git allows to remember passwords in a secure (encrypted) storage provided by your desktop environment (at least on Linux). This secure storage has to be manually configured. The commands below should work for a Debian-based distributions:
<pre>
sudo apt install libsecret-1-dev
sudo make -C /usr/share/doc/git/contrib/credential/libsecret
git config --global credential.helper /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret
</pre>
</pre>

Revision as of 08:35, 16 August 2018

Sending patches via email can be greatly simplified by using git send-email command. For general usage and overview, look at e.g. this howto.

To configure git to send email you have several options:

  1. Use your private email account. For gmail, this is documented in the git send-email man page.
  2. Use CVUT mail server as shown below.

Configuring CVUT mail server

git config --global sendemail.smtpserver mail.cvut.cz
git config --global sendemail.smtpServerPort 587
git config --global sendemail.smtpEncryption tls
git config --global sendemail.smtpUser sojkam1@cvut.cz

Of course, replace sojkam1 with your login name.

Remembering a password

Above shown configurations will ask you for a password every time you will send something. This is annoying. Luckily, git allows to remember passwords in a secure (encrypted) storage provided by your desktop environment (at least on Linux). This secure storage has to be manually configured. The commands below should work for a Debian-based distributions:

sudo apt install libsecret-1-dev
sudo make -C /usr/share/doc/git/contrib/credential/libsecret
git config --global credential.helper /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret