配置git commit时选择author

背景:

一个Linux服务器,git clone了一份代码,多个developer使用mintty连接后,都要修改某个文件。

想要在developer进行git commit时要选择自己的身份。

过程:

1.使用 git config --global --unset user.name 和 user.email 取消了全局的配置

2.在本地仓库中,使用 git config --add user.name 和 user.email 命令添加了多个user。但是在执行 git commit 操作时,发现选了最下面的user作为author。

问题:

请问:怎样配置才能让每个developer在commit时,强制选择或者输入author?

配置一个Gerrit服务可以达到你的目的, gerrit 可以限制在push的时候只能push自己作为作者的COMMENT(默认情况就有这种限制)。

一般要手动输入,git config --add user.name, git config --add user.email,配置文件 在.git下配置config