如何使用git send-email

2023-11-15

How to Use git send-email

建议使用git send-email发送补丁(更多关于发送补丁的信息请参考Community ). 本文介绍如何使用git send-email.

安装 send-email

你的git可能已经安装了,但是send-email命令不是git必需的组件。你可以使用“git send-email --help” 确认一下。如果显示send-email的man page,那么send-email已经安装再你的系统了。否则,你需要安装send-email命令。你的版本可能有一个send-email的安装包。在Debian下,这个安装包的名字是"git-email" 。

配置你的名字和Email地址

你应该告诉git你的名字和email地址。你可能已经做了这一步了,如果没有,执行下面的命令:

git config --global user.name "My Name"
git config --global user.email "myemail@example.com"

配置Mail发送选项

git send-email 发送emails通过你的SMTP 服务器, 所以你需要配置服务器参数。参考你的email提供商的文档找到正确的参数。下面是我的mail设置:

git config --global sendemail.smtpencryption tls
git config --global sendemail.smtpserver mail.messagingengine.com
git config --global sendemail.smtpuser tanuk@fastmail.fm
git config --global sendemail.smtpserverport 587
git config --global sendemail.smtppass hackme

Storing the password in the git configuration file is obviously a security risk. It's not mandatory to configure the password. If it's not configured, git send-email will ask it every time the command is used.

配置默认的目的地址

For PulseAudio, the patches should be sent to our mailing list. In order to avoid having to remember it and retyping it all the time, you can configure the address to be used by default by git send-email. As you may contribute to many projects using git, it does not make sense to set this option globally so instead we'll only set it in our clone of the PulseAudio code.

git config sendemail.to pulseaudio-discuss@lists.freedesktop.org

避免发送邮件给你自己

默认情况下,git send-email会把作者添加到Cc:field. 当你发送你自己写的patches, 这意味着每个patch的拷贝都会发送到你自己的邮箱. 如果你不喜欢这样, 你可以通过设置下面的选项来避免这种情况(see "git send-email --help" for the full list of possible values):

git config --global sendemail.suppresscc self

使用send-email命令

See "git send-email --help" for the full reference. I'll go through only the basic usage here.

git send-email will ask a few questions before the patches are sent (update: newer git versions ask fewer questions, sometimes no questions at all). Most of the questions have a sensible default value shown in square brackets. Just press enter to use the default value. Type the answer to the question if you don't want to use the default answer. The questions are:

  • Who should the emails appear to be from?
    • This will be used as the "From" header. You should have configured your name and email address earlier, so the default is usually correct.
  • Who should the emails be sent to?
  • Message-ID to be used as In-Reply-To for the first email?
    • This should usually be left empty. Don't send patches as replies to regular discussion, that makes it harder to keep track of the patches.
  • Send this email?
    • The mail headers are visible above the question, so that you can check that everything looks OK.

发送一个单独的Patch

在当前的分支发送最新的commit:

git send-email -1

发送其他的commit:

git send-email -1 <commit reference>

发送多个Patches

Sending the last 10 commits in the current branch:

git send-email -10 --cover-letter --annotate

The --cover-letter option creates an extra mail that will be sent before the actual patch mails. You can add write some introduction to the patch set in the cover letter. If you need to explain the patches, be sure to include the explanations also in the commit messages, because the cover letter text won't be recorded in the git history. If you don't think any introduction or explanation is necessary, it's fine to only have the shortlog that is included in the cover letter by default, and only set the "Subject" header to something sensible.

The --annotate option causes an editor to be started for each of the mails, allowing you to edit the mails. The option is always necessary, so that you can edit the cover letter's "Subject" header.

添加Patch版本信息

By default the patch mails will have "[PATCH]" in the subject (or "[PATCH n/m]", where n is the sequence number of the patch and m is the total number of patches in the patch set). When sending updated versions of patches, the version should be indicated: "[PATCH v2]" or "[PATCH v2 n/m]". To do this, use the --annotate option and edit the "Subject" header of the mails.

添加额外的注释到Patch Mails

Sometimes it's convenient to annotate patches with some notes that are not meant to be included in the commit message. For example, one might want to write "I'm not sure if this should be committed yet, because..." in a patch, but the text doesn't make sense in the commit message. Such messages can be written below the three dashes "---" that are in every patch after the commit message. Use the --annotate option with git send-email to be able to edit the mails before they are sent.


原文http://www.freedesktop.org/wiki/Software/PulseAudio/HowToUseGitSendEmail/

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何使用git send-email 的相关文章

  • GDB调试工具命令速查

    1 生成调试信息 一般来说GDB主要调试的是C C 的程序 要调试C C 的程序 首先在编译时 我们必须要把调试信息加到可执行文件中 使用编译 gcc g 的 g 参数可以做到这一点 gcc g test c g g test cpp 如果
  • VS C++ 程序运行错误: 0xc0...07b错误等

    问题1的出现 找不到动态库 解决方式 这个问题就是你需要找到这个动态库 并且放到exe目录同级目录 问题2的出现 今天在使用动态库的时候发现了一点问题 就是我修改了我原来的库文件 当我在另外的项目中使用的时候 我只进行了lib库和头文件的替
  • [游戏开发]UGF 配表导出工具

    0 前言 整理一下 之前做的一个配表导出工具 主要作用就是将 excel 的内容导出为数据和代码 不用每次配表都重新处理 项目的源码还有exe 都上传到了百度云 链接如下 链接 https pan baidu com s 1xW9Rc cx
  • Sublime Text的安装与配置记录

    Sublime Text作为一款优质的Code编辑器 已更新至第4个版本 本文记录关于Sublime Text 4 版本4126 的安装 汉化 以及常用配置方法 安装 访问官网下载安装包 https www sublimetext com
  • 雪花算法(SnowFlake)

    简介 现在的服务基本是分布式 微服务形式的 而且大数据量也导致分库分表的产生 对于水平分表就需要保证表中 id 的全局唯一性 对于 MySQL 而言 一个表中的主键 id 一般使用自增的方式 但是如果进行水平分表之后 多个表中会生成重复的
  • C语言之详解静态变量static

    在C语言中static是用来修饰变量和函数的 这篇文章详细介绍了static主要作用 文章中有详细的代码实例 需要的朋友可以参考阅读 在C语言中 static是用来修饰变量和函数的 static主要作用为 1 修饰局部变量 静态局部变量 2
  • gdb调试教程

    gdb调试是c c 代码调试最重要的工具了 我们今天来系统熟悉一下 太长不看版 注意 如果针对cmake项目 需要把编译模式从release改成debug 否则无法定位到准确的行数 进入gdb debugger界面 gt gdb filen
  • Keil消除特定警告办法

    使用的是KEIL5 27版本 介绍两种消除警告的办法 1 屏蔽所有警告 这个功能感觉有点自欺欺人了 不过也记下来给需要的人使用 Keil gt Options gt C C gt Warmings 选择No Warmings 一键屏蔽所有警
  • Source Insight设置黑色背景

    今天使用Source Insight看C代码 觉得背景白色太亮 觉得应该可以调背景颜色 通过百度 搜索到了CSDN上的相关文章 受益良多 但是文章后面附的style文件下载需30积分 无奈囊中羞涩 只好自己按照文章的说明调颜色 首先将背景调
  • LLVM+clang+VS Code 搭建 C++ 编译环境(windows)

    可参考LLVM clang VS Code 搭建 C 编译环境 windows
  • TortoiseGit保存git的账号密码

    TortoiseGit保存git的账号密码 问题 电脑安装了git和TortoiseGit 但是每次commit pull push时都需要输入密码 而且是无限弹密码框 输入密码之后 还继续弹框 之前看了许多解决方案都不太行 例如 1 修改
  • 分分钟提高效率的18个神仙网站,你都用过几个?

    1 ipaddress ip查询工具 https www ipaddress com 不知道本机IP 一进入网址就可以查到 还能查询到ip的详情信息 追踪域名 端口信息 2 json 在线解析工具 https www json cn 开发时
  • 静态代码扫描工具汇总

    一 概述 在软件开发过程中 开发团队往往要花费大量的时间和精力发现并修改代码缺陷 传统的代码评审 同事复审 通过人工方式来检查缺陷仍然是一件耗时耗力的事情 而静态代码扫描工具能够在代码构建过程中帮助开发人员快速 有效的定位代码缺陷并及时纠正
  • CMake 用法导览

    原文地址 http www cnblogs com coderfenghc archive 2013 01 20 2846621 html Preface 本文是CMake官方文档CMake Tutorial http www cmake
  • 如何使用git send-email

    How to Use git send email 建议使用git send email发送补丁 更多关于发送补丁的信息请参考Community 本文介绍如何使用git send email 安装 send email 你的git可能已经安
  • 在IntelliJ IDEA上将WSDL生成Java代码

    最近接触了一个android项目 但是需要自己用webService的方法获取数据 而且只给了一个wsdl的地址 今天介绍如何利用wsdl生成Java客户端并且进行测试 一 安装一个IntelliJ IDEA Windows平台 自行选择x
  • [编程工具]MarkDown编辑查看以及使用语法

    目录 0 前言 1 markDown语法 2 markDown 3 MD正确打开方式 4 结尾 结束啦感谢观看 5 参考连接 0 前言 本文介绍了markDown的编辑查看 使用浏览器查看以及Vscode中查看编辑MD 最后介绍了MD的常用
  • 基于C#的数据库文件管理助手

    我们经常会遇到这样的问题 在数据库中的文件存放的是web格式或者是绝对路径 以及使用的是百度上传或者其他上传组件 造成了很多异步上传的冗余文件 如果客户需要我们导出企业官网中的产品图片 我们该如何处理 很简单 当然是自己写个工具来读取 然后
  • VS E2996 错误过多,导致IntelliSense引擎无法正常工作。其中一些错误可能在编辑器中不可见。代码没有提示

    一 错误的问题描述 二 这个问题导致的后果 后面程序中用到的很多都会显示找不到定义 三 说实话这个问题真的很坑 由于我更换了我程序的工作电脑 我在VS中属性管理器中重新配置了头文件和对应的库目录 但是这里我犯了一个小错误 就是我更换的时候
  • Snipaste介绍、安装、使用技巧(截图贴图工具)

    一 简介 Snipaste 是一个简单但强大的截图贴图工具 也可以让你将截图贴回到屏幕上 下载并打开 Snipaste 按下 F1 来开始截图 再按 F3 截图就在桌面置顶显示了 就这么简单 你还可以将剪贴板里的文字或者颜色信息转化为图片窗

随机推荐

  • AttributeError: module ‘tensorflow‘ has no attribute ‘Session‘

    代码错误 Traceback most recent call last File D PyCharm PythonProject DRL Networking master DRL Networking master IPDPS2020
  • Real-Time Rendering——9.11 Wave Optics BRDF Models波动光学BRDF模型

    The models we have discussed in the last few sections rely on geometrical optics which treats light as propagating in ra
  • 在Linux中安装nodejs(未编译版安装方法)

    技术背景 Linux安装 nodejs 总的来说 有两种方法 第一种是安装未编译版本 然后自行编译在安装 第二种是直接安装编译版本 推荐 但作为笔记 我两种都得写 那种适合自己 自行挑选 废话不多说 我们直接上步骤 第一步 执行 wget
  • vue.js—定义全局变量、函数

    废话不多说 直接上代码 以便以后学习查看 一 全局变量 原理 1 单独新建一个全局变量模块文件 模块中定义一些变量初始状态 用export default 暴露出去 2 在main js中引入 并通过Vue prototype挂载到vue实
  • Fragment生命周期

    http blog csdn net forever crying article details 8238863 官网帮助文档链接 http developer Android com guide components fragments
  • WindowsFormsHost控件

    WPF和WinForms是两个不同的UI框架 都是由Microsoft创建的 WPF是WinForms的一个更现代的替代品 WinForms是第一个 NET UI框架 为了在两者之间轻松过渡 Microsoft确保WinForms控件仍然可
  • 我的编程语言经历

    Alan Perlis 说过 一种不改变你编程的思维方式的语言 不值得去学 虽然写了这么多年程序 用了这么多的语言 但我自认还没悟道编程语言如何改变我的思维方式 几天前 我需要用python来为 ledisdb 写一个客户端 我突然发现 对
  • adc读出的数据和输入电压不匹配

    1 参考电压输入有误 1 stm8和stm32 模拟电源输入的电压有问题 或者精度设置出错 导致最终电压参考有误 最终adc值出错 2 华大的芯片还多了一种可能 就是adc的参考源选择错误 可选的参考源包括内部1 5v参考 2 5v参考 外
  • 创业小记:终于开发了个有点希望的产品了

    过了3个月了 做了8个产品 有一个产品 有点起色 在7月有290刀的收入 3个月时间了 打算简单复盘一下 一个字 抄 二个字 参考 三个字 微创新 我是个典型的技术同学 我不建议跟我一样背景的人从开发自己有需求的产品开始 这是主流论调 就是
  • Java JDBC (MySQL5.7)

    文章目录 第一章 JDBC简介 1 JDBC的好处 第二章 JDBC使用 1 使用步骤 2 普通方式实现代码 3 优化为工具类 4 使用数据库连接池Druid 第三章 参考资料 第一章 JDBC简介 Java DataBase Connec
  • mysql distinct和order by 一起用时,order by的字段必须在select中

    原因 1 首先 在MySQL中 distinct 的执行顺序高于 order by 2 第二 distinct 执行时会对查询的记录进行去重 产生一张虚拟的临时表 3 第三 order by 执行时对查询的虚拟临时表进行排序 产生新的虚拟临
  • Windows下MySQL免安装版的下载与配置

    因为自己学习开发的需求 需要在本地安装MySQL数据库用来做本地测试 对于个人开发者 可以下载MySQL Community Server版本 该版本是免费的 安装和配置方法如下 MySQL Server下载地址 https dev mys
  • 算法通关村-----快速排序的原理和实现

    快速排序介绍 快速排序是一种经典高效的排序方法 是分治策略在排序上的具体体现 将一个大的待排序列分割成若干个小的有序序列 最终将各个小的有序序列合并成一个大的有序序列 快速排序的实现原理 选择一个基准值 将小于基准值的元素放在基准值左侧 大
  • 程序员疯抢的 Java 面试宝典(PDF 版)限时开源,别把大厂想的那么难,关键是你准备得如何

    Java 面试 2022 届高校毕业生规模预计 1076 万人 同比增加 167 万人 对于 22 届的同学们来说 今年下半年大规模进行的秋招是获得全职 Offer 的最重要的途径 对于程序员来说 大家都知道校招难度相对于社招来说会有所降低
  • Windows IIS服务器建站/网站配置全图文流程(新手必备!) 一条龙

    阿里ECS云服务器购买配置全教程 本文提供全图文流程 中文翻译 Chinar 坚持将简单的生活方式 带给世人 拥有更好的阅读体验 高分辨率用户请根据需求调整网页缩放比例 Chinar 心分享 心创新 助力快速完成服务器的购买 配置 以及网站
  • vite 和 webpack 优缺点对比

    Vite 和 Webpack 都是前端构建工具 它们有一些相似之处 也有一些不同之处 下面是 Vite 和 Webpack 的优缺点对比 Vite 的优点 快速的开发者体验 Vite 可以实现快速的冷启动和热更新 使开发者可以迅速地获取反馈
  • [QT编程系列-21]:基本框架 - QT常见数据结构:QString、QList、QVector、QMap、QHash、QSet、QPair详解

    目录 1 QString 2 QList 3 QVector 4 QMap 5 QHash 6 QSet 7 QPair 1 QString QString是Qt中用于存储和操作字符串的类 它提供了丰富的字符串处理方法和功能 以下是QStr
  • 基于改进SEIR模型的病毒传播动力学建模与疫情预测分析(以COVID-19新冠病毒为例,超详细,带matlab源码)

    文章目录 前言 一 数学基础知识 符号定义 二 传统SEIR模型的建立与求解 1 经典的SEIR传播动力学模型建立 2 根据经典的SEIR模型列出微分方程并求解 三 SEIR模型第一次修正 1 模型建立 2 模型求解 四 SEIR模型的第二
  • C++项目实战-makefile

    makefile简介 一个工程中的源文件不计其数 一个项目有有很多的文件 现在的项目基本都是按模块进行划分的 而这些模块存放在若干目录中 makefile中定义了一系列的规则 这些规则定义了一系列如何编译程序的操作 比如哪些文件需要编译 哪
  • 如何使用git send-email

    How to Use git send email 建议使用git send email发送补丁 更多关于发送补丁的信息请参考Community 本文介绍如何使用git send email 安装 send email 你的git可能已经安