如何在我的git补丁中添加2个签名?

时间:2012-12-06 14:41:57

标签: git

我想用命令

生成一个git补丁
git format-patch master -s

但上面的命令生成了我的电子邮件(已定义)已签名的补丁。并且Iwant用2封电子邮件生成补丁,如下所示:

Signed-off-by: firstname1 lastname1 <person1@email1.com>
Signed-off-by: firstname2 lastname2 <person2@email1.com>

注意:我想通过命令行自动添加它,而不是手动将其添加到补丁文件

1 个答案:

答案 0 :(得分:1)

更改提交者身份

GIT_COMMITTER_NAME="John Doe" GIT_COMMITTER_EMAIL=john.doe@skynet.com git format-patch master -s

这将产生(在每个补丁中)

Signed-off-by: John Doe <john.doe@skynet.com>

要添加一个额外的'Signed-off-by',我担心你必须使用外部,即

sed -i '/Signed-off-by/ a\
Signed-off-by: Jane Doe <jane.doe@skynet.com>' *.patch

这将产生(在每个补丁中)

Signed-off-by: John Doe <john.doe@skynet.com>
Signed-off-by: Jane Doe <jane.doe@skynet.com>