1

我想用命令生成一个 git 补丁

git format-patch master -s

但是上面的命令会生成带有我的电子邮件(已经定义)作为签名的补丁。我想生成带有 2 封电子邮件的补丁,如下所示:

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

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

4

1 回答 1

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>

要添加额外的“签名人”,恐怕您必须使用外部即

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>
于 2012-12-06T16:44:34.487 回答