致命:.git/info/refs 无效:这是 git 存储库吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/43049278/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
fatal: .git/info/refs not valid: is this a git repository?
提问by Omri Shneor
I have a Git repository hosted at Assembla for which I'm trying to perform:
我有一个托管在 Assembla 的 Git 存储库,我正在尝试执行:
git push -u origin master
I'm getting the following error over and over again:
我一遍又一遍地收到以下错误:
fatal: https://[url]/[repo-name].git/info/refs not valid: is this a git repository?
I've tried the answer here without any success: Git .git/info/refs not valid: is this a git repository?
我在这里尝试了答案但没有任何成功:Git .git/info/refs not valid: is this a git repository?
When I use:
当我使用:
git status
I get:
我得到:
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
回答by Omri Shneor
git remote show origin
showed that the remote repository I tried to push to wasn't correct.
显示我尝试推送到的远程存储库不正确。
After fixing that with:
修复后:
git remote set-url origin [REPO-URL]
the problem was solved.
问题解决了。
回答by TheJeff
Make sure the proxy is set correctly for Git if you're behind a proxy!
如果您使用代理,请确保为 Git 正确设置了代理!
git config --global http.proxy <proxyserver>
回答by Chris Lee
In Safari, input and jump to your Git repository URL again. systerm will let you authorization. Use the Git account and password again, then open your Xcode, and you can pull smoothly.
在 Safari 中,再次输入并跳转到您的 Git 存储库 URL。系统会让你授权。再次使用Git账号和密码,然后打开你的Xcode,就可以顺利拉取了。