git说项目描述文件即使在实际修改时也没有被修改过

时间:2009-03-31 13:26:29

标签: git

我在Mac OS X 10.5.5上,当我尝试执行git push(我已经通过谷歌代码上的git安装程序安装了git)时,它显示以下错误

Counting objects: 86, done.
Compressing objects: 100% (43/43), done.
Writing objects: 100% (84/84), 4.68 MiB | 48 KiB/s, done.
Total 84 (delta 37), reused 84 (delta 37)
*** Project description file hasn't been set
error: hooks/update exited with error code 1
error: hook declined to update refs/heads/master
To <my_git_server>:project_name.git
 ! [remote rejected] master -> master (hook declined)
error: failed to push some refs to '<my_git_server>'

神秘之处在于项目描述文件实际设置,任何想法为什么它可能表现得很奇怪。

-
MI

1 个答案:

答案 0 :(得分:5)

正在查看服务器上的项目描述; <my_git_server>:project_name.git是否包含名为description的文件,其中包含“未命名的存储库”以外的内容?

如果确实如此,并且您仍然遇到问题,则可以完全禁用对描述的检查;这不是必需的。在project_name.git/hooks/update中注释掉以下几行:

# check for no description
projectdesc=$(sed -e '1q' "$GIT_DIR/description")
case "$projectdesc" in
"Unnamed repository"* | "")
        echo "*** Project description file hasn't been set" >&2
        exit 1
        ;;
esac