【发布时间】:2015-12-03 11:14:36
【问题描述】:
我有一个位于服务器上的裸 git 存储库和一个使用 git-shell 进行 ssh 通信的用户。
问题是当我在服务器上与该用户一起推送我的提交时,我无法强制使用用户名和用户电子邮件。
我在用户家设置~/.gitshrc:
export GIT_AUTHOR_NAME="John Doe"
export GIT_COMMITTER_NAME="John Doe"
还有~/.gitconfig文件
[user]
name = John Doe
email = johndoe@example.com
但我在 git 日志中得到的只是客户端设置的用户名和用户电子邮件。
如何在git-shell中重写用户名和用户邮箱?
【问题讨论】:
-
你能发布
git config --list返回的内容吗? -
以下 2 个命令是否在终端上工作? ; $ git config --global user.name "John Nash" $ git config --global user.email johndoe@example.com
-
@karatedog 服务器端:git config --list user.name=John Doe user.email=johndoe@example.com 客户端:user.name=不是真正的user.email=some_email@ example.com
-
@NishantSingh 是的,这就是我用来在 gitconfig 文件中设置选项的内容