在git merge上覆盖作者 [英] Override author on git merge

查看:117
本文介绍了在git merge上覆盖作者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有--git commit的作者-git-merge?

Is there an option like --author of git-commit for git-merge?

我们维护了一个临时环境,必须执行一些更改。某些限制使我们只能使用一个Linux用户来访问暂存环境。

We maintain a staging environment where some changes must be performed. Some limitations make us to use only one linux user to access staging environment.

无论如何,我们是一个具有合作主动性的小团队,我们会在进行提交时告知,哪个是作者使用--author git-commit选项。但是,有时我们需要从其他分支进行合并,从而导致非ff合并。

Anyway, we are a small team with cooperative initiative and we tell when doing commits, which one is the author using the --author git-commit option. However, some times we need to merge from other branches which result in a non-ff merge. This implies a commit is performed when doing this merge.

在这种情况下,哪种方法是手动指定作者的最佳方式?

Which would be the best way to specify the author manually for the merge commit in this case?

推荐答案

首先,阻止合并创建提交:

First, prevent the merge from creating the commit:

git merge --no-commit …

然后,手动进行提交:

git commit --author="A. U. Thor <au@th.or>"

这篇关于在git merge上覆盖作者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆