在 Github 存储库上运行“git update-server-info”错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9343189/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 13:00:41  来源:igfitidea点击:

"did you run git update-server-info" error on a Github repository

gitgithubgithub-for-mac

提问by Paul

I'm using the github Gui from their website to manage my repos, and I'm getting the following error:

我正在使用他们网站上的 github Gui 来管理我的存储库,但出现以下错误:

fatal: https://github.com/TeaCodie/TeaCodie-Website.git/info/refs not found: 
did you run git update-server-info on the server?

How can I fix this?

我怎样才能解决这个问题?

回答by Javier Giovannini

You might have changed your repository name

您可能已更改存储库名称

In your local repository edit the file:

在您的本地存储库中编辑文件:

.git/config

Then check:

然后检查:

[remote "origin"]
   url = 

that the URL matches your remote repository

该 URL 与您的远程存储库匹配

回答by navins

Did you create a new repository on the http://github.comwith the same name?

你上创建一个新的存储库http://github.comsame name

If not, do it! And make sure each letter is correctand case sensitive.

如果没有,那就去做吧!并确保每个字母都正确区分大小写

回答by amolk

In my case my github account did not have permissions to the repo. Added the github account as a collaborator for the repo and that fixed it.

在我的情况下,我的 github 帐户没有 repo 的权限。添加了 github 帐户作为 repo 的合作者并修复了它。

回答by Wendy William

This error mostly caused by WRONG URL, please check:

此错误主要是由错误的 URL 引起的,请检查:

  • http or https
  • URL Name
  • username@git_url
  • wrong git name
  • http 或 https
  • 网址名称
  • 用户名@git_url
  • 错误的 git 名称

回答by FauxFaux

It looks like that's a private (or deleted) repository; if you visit the repository page while logged it'll give you the real URL, which'll probably be https://[email protected]/TeaCodie/TeaCodie-Website.git, i.e. with a username specified?

看起来这是一个私有(或已删除)存储库;如果您在登录时访问存储库页面,它将为您提供真实的 URL,可能是https://[email protected]/TeaCodie/TeaCodie-Website.git,即指定了用户名?

回答by alexvance

Also make sure the repo you've entered is cased correctly (it's case sensitive).

还要确保您输入的存储库大小写正确(区分大小写)。

回答by John LaBarge

My issue was that I used the clone https url widget provided by github. That URL doesn't work for private repositories as you need to add a username to the front of it.

我的问题是我使用了 github 提供的克隆 https url 小部件。该 URL 不适用于私有存储库,因为您需要在其前面添加用户名。

Example: a private repo owned by john and named widget with collaborator sam the correct url would be:

示例:由 john 拥有并命名为小部件的私有仓库,协作者 sam 正确的 url 为:

https://[email protected]/john/widget.git

https://[email protected]/john/widget.git

The github provided url:

github提供的网址:

https://github.com/john/widget.git

https://github.com/john/widget.git

The error message leaves much to be desired.

错误消息还有很多不足之处。

回答by Senseful

I got the same problem while using a github repository, and connecting to it via https, while using the OS X Keychain Credential helper.

我在使用 github 存储库并通过https连接到它时遇到了同样的问题,同时使用了OS X Keychain Credential helper

My problem was that I had the wrong credentials stored in OS X's Keychain (I was using the email address that I used to sign up for github.com rather than the [username]@github.com address it provides you). I deleted the old account in the keychain and only left the @github.com one and it fixed the problem.

我的问题是我在 OS X 的钥匙串中存储了错误的凭据(我使用的是我用来注册 github.com 的电子邮件地址,而不是它为您提供的 [username]@github.com 地址)。我删除了钥匙串中的旧帐户,只留下了@github.com 一个,它解决了问题。

Not sure if it is related, but when I checked the user.emaillocal config:

不确定它是否相关,但是当我检查user.email本地配置时:

git config -l

it showed the incorrect email address as well, so I updated the local git user.emailto use the correct account too:

它也显示了不正确的电子邮件地址,所以我更新了本地 gituser.email以使用正确的帐户:

git config user.email <username>@github.com

回答by Mark

Make sure that your user account is added to the repository as a collaborator.

确保您的用户帐户作为协作者添加到存储库中。

Setting --> Collaborators

设置 --> 协作者

回答by FrankFan

I met up with the same problem.
How I solved this problem is:
I use git bash to create a new repo, when I typed "git push origin master" It reported

我遇到了同样的问题。
我解决这个问题的方法是:
当我输入“git push origin master”时,我使用git bash创建了一个新的repo,它报告了

"fatal: https://github.com/TeaCodie/TeaCodie-Website.git/info/refsnot found: did you run git update-server-info on the server?"

“致命:https: //github.com/TeaCodie/TeaCodie-Website.git/info/refs未找到:您是否在服务器上运行了 git update-server-info?”

Finally, I found there was not a repo on the github at all.
You'd better create a new repo first on github.

最后发现github上根本没有repo。
你最好先在github上创建一个新的repo。

Maybe this experience can help somebody.

也许这种经验可以帮助某人。