Git fetch/pull have stopped working

社会主义新天地 提交于 2019-12-06 19:58:19

问题


Git fetch and pull both stopped working yesterday on the server (AWS instance).

$ git fetch
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly

There are two repository clones on that instance, both giving the same error. git still works well from local PCs.

git remote -v gives the same results on local PC and on the server; ssh git@github.com works as it should ("Hi (name)! You've successfully authenticated, but GitHub does not provide shell access.")

There's one difference in behaviour: git pull origin st+[Tab] used to expand to a branch name; now it expands to a name of the file in current directory (filename is not the same as branch name).

UPDATE: I tried re-creating remote: SSH version still fails, but HTTP worked.

According to this discussion in git mailing list, this is actually a problem on GitHub site.

UPDATE

output with GIT_TRACE=1

############# Local results #############

$ GIT_TRACE=1 git fetch
setup: git_dir: .git
setup: worktree: c:/Projects/(local_path)
setup: cwd: c:/Projects/(local_path)
setup: prefix: (null)
trace: built-in: git 'fetch'
trace: run_command: 'ssh' 'git@github.com' 'git-upload-pack '\''(username)/(reponame).git'\'''
Enter passphrase for key '(keyname)':
trace: run_command: 'rev-list' '--quiet' '--objects' '--stdin' '--not' '--all'


############# AWS results #############

$ GIT_TRACE=1 git fetch
trace: built-in: git 'fetch'
trace: run_command: 'ssh' 'git@github.com' 'git-upload-pack '\''(username)/(reponame).git'\'''
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly

回答1:


Problem solved.

Turns out that was a miscommunication on our side: the guy who setup the keys on that box left, and his access to GH repo has been revoked.

GitHub returns "repo not found" rather than "you have no access rights for this repository" - their support said they didn't want to leak the existence of a repo unless you have access rights to it.



来源:https://stackoverflow.com/questions/10438082/git-fetch-pull-have-stopped-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!