Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git post-receive hook "empty ident name"

Tags:

git

gitlab

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 "[email protected]"
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 <[email protected]>) not allowed

When running git config -l from the git user:

user.name=server
[email protected]
core.autocrlf=input
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
[email protected]:chris/heartbeat.git
branch.master.remote=origin
branch.master.merge=refs/heads/master

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?

like image 906
user2817219 Avatar asked Jul 20 '14 11:07

user2817219


1 Answers

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 [email protected]
like image 148
VonC Avatar answered Sep 19 '22 23:09

VonC