git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/3] docs: improve send-email documentation

From
Aditya Garg <gargaditya08@live.com>
Date
May 4, 2025, 13:54 UTC
Message-ID
<PN3PR01MB95977D3ACA96D04442960136B88F2@PN3PR01MB9597.INDPRD01.PROD.OUTLOOK.COM>
In-Reply-To
<PN3PR01MB9597FADD19D6BBCE3FCD4FBCB88F2@PN3PR01MB9597.INDPRD01.PROD.OUTLOOK.COM>
This commit does the following changes to the send email doc:
1. Added examples to use OAuth2.0 with Gmail and Outlook.
2. Improved examples to send patches using git send-email
3. Added links of credential helpers for Gmail and Outlook
Signed-off-by: Aditya Garg <gargaditya08@live.com>
---
 Documentation/git-send-email.adoc | 106 ++++++++++++++++++++++++++----
 1 file changed, 93 insertions(+), 13 deletions(-)
diff --git a/Documentation/git-send-email.adoc b/Documentation/git-send-email.adoc
index 92389036fa..ada883289a 100644
--- a/Documentation/git-send-email.adoc
+++ b/Documentation/git-send-email.adoc
@@ -509,12 +509,12 @@ include::includes/cmd-config-section-all.adoc[]
 
 include::config/sendemail.adoc[]
 
-EXAMPLES
---------
-Use gmail as the smtp server
+EXAMPLES OF SMTP SERVERS
+------------------------
+Use Gmail as the SMTP server
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-To use 'git send-email' to send your patches through the GMail SMTP server,
-edit ~/.gitconfig to specify your account settings:
+To use 'git send-email' to send your patches through the Gmail SMTP server,
+edit '~/.gitconfig' to specify your account settings:
 
 ----
 [sendemail]
@@ -528,17 +528,97 @@ If you have multi-factor authentication set up on your Gmail account, you can
 generate an app-specific password for use with 'git send-email'. Visit
 https://security.google.com/settings/security/apppasswords to create it.
 
-Once your commits are ready to be sent to the mailing list, run the
-following commands:
+You can also use OAuth2.0 authentication with Gmail. For that edit ~/.gitconfig
+and add `smtpAuth = OAUTHBEARER` to your account settings:
+
+----
+[sendemail]
+	smtpEncryption = tls
+	smtpServer = smtp.gmail.com
+	smtpUser = yourname@gmail.com
+	smtpServerPort = 587
+	smtpAuth = OAUTHBEARER
+----
+
+Use Microsoft Outlook as the SMTP server
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Unlike Gmail, Microsoft Outlook no longer supports app-specific passwords.
+Therefore, we have to use OAuth2.0 authentication for Outlook.
+
+Edit '~/.gitconfig' to specify your account settings for Outlook and use its
+SMTP server with 'git send-email':
+
+----
+[sendemail]
+	smtpEncryption = tls
+	smtpServer = smtp.office365.com
+	smtpUser = yourname@outlook.com
+	smtpServerPort = 587
+	smtpAuth = XOAUTH2
+----
+
+SENDING PATCHES
+---------------
+The following examples can be used to have a basic idea on how to send patches
+to a mailing list:
+
+If you want to send a single patch, run:
+
+	$ git send-email --to="mailinglist@example.org" HEAD~1
+
+You can also add `--annotate` to edit the patches before sending:
+
+	$ git send-email --annotate --to="mailinglist@example.org" HEAD~1
+
+Multiple patches can also be sent. For example, if you want to send the last 3
+commits as patches, run:
+
+	$ git send-email --to="mailinglist@example.org" HEAD~3
+
+You can also add a cover letter. It is useful especially in case of multiple
+patches. Note the use of `--annotate` here since we have to edit the cover letter
+before sending it:
+
+	$ git send-email --annotate --cover-letter --to="mailinglist@example.org" HEAD~3
+
+Versions of a patch series can also be specified. For example to send a version 2:
+
+	$ git send-email --to="mailinglist@example.org" -v2 HEAD~1
+
+You can also specify custom subject prefixes. For example, to have '[PATCH RESEND]'
+as a prefix, run:
+
+	$ git send-email --to="mailinglist@example.org" --subject-prefix='PATCH RESEND' HEAD~1
+
+You can also Cc someone like this:
+
+	$ git send-email --to="mailinglist@example.org" --cc="someone@example.com HEAD~1
+
+Multiple `--to` can also be specified:
+
+	$ git send-email --to="list1@example.org" --to="list2@example.com HEAD~1
+
+Similarly you can specify multiple `--cc` as well.
 
-	$ git format-patch --cover-letter -M origin/master -o outgoing/
-	$ edit outgoing/0000-*
-	$ git send-email outgoing/*
 
 The first time you run it, you will be prompted for your credentials.  Enter the
-app-specific or your regular password as appropriate.  If you have credential
-helper configured (see linkgit:git-credential[1]), the password will be saved in
-the credential store so you won't have to type it the next time.
+app-specific or your regular password as appropriate.
+
+If you have credential helper configured (see linkgit:git-credential[1]), the
+password will be saved in the credential store so you won't have to type it the
+next time.
+
+If you are using OAuth2.0 authentication, you need to use an access token in
+place of a password when prompted. Various OAuth2.0 token generators are
+available online. Community maintained credential helpers with OAuth2.0 support
+for Gmail and Outlook are also available:
+
+	- https://github.com/AdityaGarg8/git-credential-outlook-and-gmail[git-credential-gmail] (cross platform, dedicated helper for authenticating Gmail accounts)
+
+	- https://github.com/AdityaGarg8/git-credential-outlook-and-gmail[git-credential-outlook] (cross platform, dedicated helper for authenticating Microsoft Outlook accounts)
+
+You can also see linkgit:gitcredentials[7] for more OAuth based authentication
+helpers.
 
 Note: the following core Perl modules that may be installed with your
 distribution of Perl are required:
-- 
2.49.0
Previous: Kristoffer HaugsbakkNext: Aditya Garg
Message 6 of 68 in “Improve checks for valid_fqdn in send-email and update documentation”
  1. 0/3 Improve checks for valid_fqdn in send-email and update documentationAditya Garg, May 4, 2025
  2. 1/3 send-mail: improve checks for valid_fqdnAditya Garg, May 4, 2025
  3. Kristoffer HaugsbakkMay 4, 2025
  4. Aditya GargMay 4, 2025
  5. Kristoffer HaugsbakkMay 4, 2025
  6. 2/3 docs: improve send-email documentationAditya Garg, May 4, 2025
  7. 3/3 docs: add credential helper for outlook and gmail in OAuth list of helpersAditya Garg, May 4, 2025
  8. 0/3 Improve checks for valid_fqdn in send-email and update documentationAditya Garg, May 5, 2025
  9. 1/3 send-mail: improve checks for valid_fqdnAditya Garg, May 5, 2025
  10. 2/3 docs: improve send-email documentationAditya Garg, May 5, 2025
  11. Junio C HamanoMay 5, 2025
  12. Aditya GargMay 5, 2025
  13. 3/3 docs: add credential helper for outlook and gmail in OAuth list of helpersAditya Garg, May 5, 2025
  14. 0/3 Improve checks for valid_fqdn in send-email and update documentationAditya Garg, May 5, 2025
  15. 3/3 docs: add credential helper for outlook and gmail in OAuth list of helpersAditya Garg, May 5, 2025
  16. 1/3 send-mail: improve checks for valid_fqdnAditya Garg, May 5, 2025
  17. Junio C HamanoMay 5, 2025
  18. Aditya GargMay 6, 2025
  19. Aditya GargMay 6, 2025
  20. Aditya GargMay 6, 2025
  21. Junio C HamanoMay 6, 2025
  22. Junio C HamanoMay 6, 2025
  23. Aditya GargMay 6, 2025
  24. Aditya GargMay 6, 2025
  25. Junio C HamanoMay 6, 2025
  26. 2/3 docs: improve send-email documentationAditya Garg, May 5, 2025
  27. Junio C HamanoMay 5, 2025
  28. Aditya GargMay 6, 2025
  29. 0/3 Improve checks for valid_fqdn in send-email and update documentationAditya Garg, May 7, 2025
  30. 1/3 send-mail: improve checks for valid_fqdnAditya Garg, May 7, 2025
  31. Aditya GargMay 7, 2025
  32. Junio C HamanoMay 7, 2025
  33. Aditya GargMay 8, 2025
  34. 2/3 docs: improve send-email documentationAditya Garg, May 7, 2025
  35. Junio C HamanoMay 7, 2025
  36. Aditya GargMay 8, 2025
  37. Junio C HamanoMay 8, 2025
  38. Aditya GargMay 8, 2025
  39. Junio C HamanoMay 8, 2025
  40. Aditya GargMay 8, 2025
  41. Junio C HamanoMay 8, 2025
  42. Aditya GargMay 8, 2025
  43. Aditya GargMay 8, 2025
  44. 3/3 docs: add credential helper for outlook and gmail in OAuth list of helpersAditya Garg, May 7, 2025
  45. 0/3 Improve checks for valid_fqdn in send-email and update documentationAditya Garg, May 8, 2025
  46. 1/3 send-mail: improve checks for valid_fqdnAditya Garg, May 8, 2025
  47. 2/3 docs: improve send-email documentationAditya Garg, May 8, 2025
  48. 3/3 docs: add credential helper for outlook and gmail in OAuth list of helpersAditya Garg, May 8, 2025
  49. 0/3 Improve checks for valid_fqdn in send-email and update documentationAditya Garg, May 8, 2025
  50. 1/3 send-mail: improve checks for valid_fqdnAditya Garg, May 8, 2025
  51. 2/3 docs: improve send-email documentationAditya Garg, May 8, 2025
  52. 3/3 docs: add credential helper for outlook and gmail in OAuth list of helpersAditya Garg, May 8, 2025
  53. Junio C HamanoMay 8, 2025
  54. send-email: try to get fqdn by running hostname --fqdn on Linux and macOSAditya Garg, May 9, 2025
  55. Junio C HamanoMay 9, 2025
  56. send-email: try to get fqdn by running hostname --fqdn on Linux and macOSAditya Garg, May 10, 2025
  57. Julian SwagemakersMay 12, 2025
  58. Aditya GargMay 12, 2025
  59. Junio C HamanoMay 12, 2025
  60. Aditya GargMay 12, 2025
  61. Junio C HamanoMay 12, 2025
  62. Aditya GargMay 12, 2025
  63. Eric SunshineMay 12, 2025
  64. Junio C HamanoMay 12, 2025
  65. Aditya GargMay 13, 2025
  66. Junio C HamanoMay 12, 2025
  67. send-email: try to get fqdn by running hostname -f on Linux and macOSAditya Garg, May 12, 2025
  68. send-email: try to get fqdn by running hostname -f on Linux and macOSAditya Garg, May 12, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.