致命:https://github.com/user/repo.git/info/refs not found:你在服务器上运行git update-server-info了吗?

zar*_*zar -1 github github-for-mac

我正在运行以下脚本在GitHub上设置git存储库:

Global setup:
  git config --global user.name "Your Name"
  git config --global user.email email_id@email.com

Next steps:
  mkdir MultiView
  cd MultiView
  git init
  touch README
  git add README
  git commit -m 'first commit'
  git remote add origin https://github.com/nalgene/MultiView.git
  git push -u origin master
Run Code Online (Sandbox Code Playgroud)

最后一行git push -u origin master或者git push origin master那件事会返回一个错误:

fatal: https://github.com/naglene/MultiView.git/info/refs not found: did you run git update-server-info on the server?
Run Code Online (Sandbox Code Playgroud)

我研究了这个问题,看起来最可能的原因是打字错误(区分大小写),但我确信这不是问题.我git remote -v以前检查原点是否正确.还有什么问题呢?

Hol*_*ust 5

你必须仔细检查你的拼写.根据Github的指南,您的用户名是nalgene,因此URL是https://github.com/nalgene/MultiView.git.错误消息提示您添加了远程https://github.com/naglene/MultiView.git用户名,因为您交换了lg.

此外,默认分支被调用master,而不是maastermater.