git post-receive hook“空白ident名称” [英] git post-receive hook "empty ident name"
问题描述
我已经构建了以下post-receive hook:
I have built the following post-receive hook:
#!/bin/sh
cd /var/node/heartbeat/ || exit
unset GIT_DIR
echo $USER
git pull --no-edit
当我推送到存储库时,将返回以下错误:
When I'm pushing to the repository the following error is returned:
remote:
remote: From server.net:chris/heartbeat
remote: c0df678..5378ade master -> origin/master
remote:
remote: *** Please tell me who you are.
remote:
remote: Run
remote:
remote: git config --global user.email "you@example.com"
remote: git config --global user.name "Your Name"
remote:
remote: to set your account's default identity.
remote: Omit --global to set the identity only in this repository.
remote:
remote: fatal: empty ident name (for <git@server.net>) not allowed
从git用户运行git config -l时:
When running git config -l from the git user:
user.name=server
user.email=server@server.com
core.autocrlf=input
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
remote.origin.url=git@server.net:chris/heartbeat.git
branch.master.remote=origin
branch.master.merge=refs/heads/master
我不明白为什么它仍然认为我的user.email和user.name是空的,因为git config -l告诉我它不是。有人知道这个问题的解决方案/解决方法吗?
I don't understand why it's still thinking that my user.email and user.name are empty as git config -l tells me it's not. Does anyone know a solution/workaround for this problem?
推荐答案
为了确保这项工作, git config --local -l </ code>需要返回用户名和电子邮件。
To make sure this work, a git config --local -l
needs to return the user name and email.
如果没有,请转到服务器上的回购站,并输入;
If it doesn't, go to that repo on the server, and type;:
git config user.name server
git config user.email server@server.com
这篇关于git post-receive hook“空白ident名称”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!