尝试推送到我设置的运行 GitStack 的 Windows 服务器时出现此错误。
致命:未找到 http://xx.xx.x.xxx/mjtest.git/info/refs:您是否在服务器上运行了 git update-server-info?
这个错误在 Git、GitBash 和 GitStack 的新手中似乎很常见,所以我找到了一些可能的解决方案,但似乎没有一个对我有用。
这就是导致错误的原因,首先我在 GitStack 中创建了一个名为 mjtest 的空存储库,然后我创建了一个用户并将其添加到存储库并授予他们读写权限,然后我使用 GitBash 创建本地存储库并尝试推送它。
git config --global user.name "XXXXXXX"
git config --global user.email XXXXXXX
mkdir ~/mjtest
cd ~/mjtest
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin http://XX.XX.X.XXX/mjtest.git
git push origin master
然后这会要求我输入用户名,然后输入正确的密码。输入后,它会返回 fatal error 消息。
如有任何帮助,我们将不胜感激。
最佳答案
它可能与 control access issue 有关.
这通常发生在 repo 尚未设置为导出时(通过 git-daemon
或 gitweb
):GitStack 可以依赖类似的机制。
参见 this thread例如/
I created an 'empty' file with the name "
git-daemon-export-ok
' inside one of my repositories.
I can now clone / push / pull to this repository without issues.
该文件应该直接在服务器上裸仓库的 xxx.git
根目录下创建。
关于找不到 git fatal error refs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12953500/