如何确定在Git中进行摘樱桃的提交者? [英] How can one determine the committer of a cherry-pick in Git?
问题描述
在Git中,cherry-pick
至少在没有冲突的情况下保留原始提交的作者,时间戳等.但是,是否有任何方法可以确定哪些用户执行了将提交提交到新分支的自动选择"?
In Git, cherry-pick
retains the original commit's author, timestamp etc, at least when there are no conflicts. But is there any way to determine what user performed the cherry-pick which brought that commit to the new branch?
推荐答案
作者将从最初的提交中挑选出来,但是提交者(用git log --format=full
显示)将是挑选樱桃的人.此提交者字段不安全,因为Cherry-Pick提交的创建最终受Cherry-Picker的控制.跟踪提交创建者(在这种情况下为樱桃挑剔"发起人)的唯一可靠方法是注销提交.
The author will be picked up from the original commit, but the committer (shown with git log --format=full
) will be the one doing the cherry picking. This committer field is not secure, as cherry-pick commit creation is ultimately under the control of the cherry-picker. The only reliable way to track the commit creator, in this case the cherry pick instigator, is by signing off on the commit.
一种更简单的方法是仔细记录git服务器上的推送.推送引入的提交指示谁选择了摘樱桃,或者更准确地说,是谁出版了樱桃.
A simpler method is to carefully log pushes on the git server. The commits introduced by a push indicate who did the cherry-pick or, more precisely, who published it.
这篇关于如何确定在Git中进行摘樱桃的提交者?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!