tags:

views:

4859

answers:

5

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?

+16  A: 

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.

MDCore
The exact problem is that if the hooks/update script has execute permissions, it will try and execute, which means your stuff will break. :(
Paul Wicks
Git 1.6 should fix this problem by ignoring the pre-installed hooks until you rename them. So newer Git users on Windows should stop seeing this problem once Git 1.6 becomes widespread.
tialaramex
Had this occur to me using 1.6.0.4 in Cygwin. Deleting the update file fixed it for me.
bradtgmurray
+7  A: 

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".

I definitely have some content in .git/description, yet I still get the error.
James A. Rosen
The content must be different of the one git added by default.
takeshin
I'm going to put the french description in even though I cannot speak the language...
Rimian
+1  A: 

i got this error as well when pushing from macosx (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 local and remote repository and that fixed it

A: 

editing both .git/description files worked. thank you.

mirza
A: 

I had the same issue as @dragulesq but with a Redhat server.

Just 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 osx); 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).

Dominic Webb