git说项目描述文件没有被修改,即使它实际上被修改了

标签 git

我在 Mac OS X 10.5.5 上,当我尝试执行 git push(我已经通过 google code 上可用的 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>'

神秘的是项目描述文件实际上设置了,不知道为什么它可能表现得很奇怪。

--

最佳答案

正在查看服务器上的项目描述;做 <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

关于git说项目描述文件没有被修改,即使它实际上被修改了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/700941/

相关文章:

git - git merge-base 是可交换的吗?

git - 从具有多个分支及其历史的 TFS 迁移到 GIT

git - git 中的分支会创建父子关系吗?

python - 我是否需要将 dist 文件夹提交到 git 以便能够使用 git 中的 pip 安装软件包?

git - 我如何在 git 中请求一个分支的完整差异?

除非我重置,否则 Git 已经是最新的

linux - 通过 ssh 使用 git 不会获取私钥

来自本地文件夹的 git 子模块

node.js - GitHub 检测到依赖项中的漏洞,但我运行了 npm update 并且依赖项没有更新?

git - 适用于 Mac 的 Visual Studio : how to create new git branch