Reputation: 65570
I've a small project that I want to share with a few others on a machine that we all have access to. I created a bare copy of the local repo with
git clone --bare --no-hardlinks path/to/.git/ repoToShare.git
I then moved repoToShare.git to the server.
I can check it out with the following:
git clone ssh://user@address/opt/gitroot/repoToShare.git/ test
I can then see everything in the local repo and make commits against that. When I try to push changes back to the remote server I get the following error.
*** Project description file hasn't been set
error: hooks/update exited with error code 1
error: hook declined to update refs/heads/master
Any ideas?
Upvotes: 11
Views: 16025
Reputation: 11
Delete file or prevent its execution seem extreme solutions. If you don't want to add a project description, it's enough comment or delete the lines in hooks/update that are blocking the push actions. In my file, these lines are:
# check for no description
projectdesc=$(sed -e '1q' "$GIT_DIR/description")
if [ -z "$projectdesc" -o "$projectdesc" = "Unnamed repository; edit this file to name it for gitweb." ]; then
echo "*** Project description file hasn't been set" >&2
exit 1
fi
When I commented them out, everything worked fine.
Upvotes: 1
Reputation: 3845
chmod -x hooks/update
the above command executed from your .git directory will only remove execute permissions from the update hook. No need to delete the file
Upvotes: 1
Reputation: 73
I had the same issue as @dragulesq but with a Red Hat server.
To be a bit more verbose just put whatever you want as a string in the .git/description file on your local (in my case my Mac OS X); I put website and then on the remote server that hosts the Git repo (as so to speak) edit the .git/description file and put the same string in again (e.g. website).
Upvotes: 0
Reputation:
I got this error as well when pushing from Mac OS X (Git version 1.6.1, compiled with MacPorts) to an Ubuntu remote repository (Git version 1.5.4.3)
I've added the name of repository in the .git
/description file on both the local and remote repository and that fixed it.
Upvotes: 2
Reputation: 18115
Git installs a bunch of pre-configured hooks in the hooks directory, out of the box they do not execute. If you happen to allow execute on them (Eg. chmod +x) then git will try to run them. The particular error pops up cause the default update is failing to run. To fix, delete the default update hook.
Does this link help? From the text:
A colleague of mine experienced a similar issue here where push was not working. You could not push to a local or remote public repository. He was getting a project description file hasn't been set error thrown by .git/hooks/update. This error was not happening for the same project on a linux or Windows box, and seemed to be happening only on Windows Vista. From my research hooks/update is not by default executed, but in windows vista the file permissions meant that it was. Deletion of hooks/update resolved these issues.
Upvotes: 19
Reputation:
Deleting hooks/update is not what you want to do.
Just change .git/description to whatever you want - for instance "FOOBAR repository", or, if you are French, "Le depot de FOOBAR".
Upvotes: 16