Git 突然找不到 Github 仓库了

问题描述 投票:0回答:2

我有一个由我的 github 帐户管理的 Github 组织。我的所有存储库都运行良好。当我创建新存储库时,我将其设置为私有并将我的 Github 帐户添加为协作者。突然间,我所有计算机上的所有存储库都停止了“工作”。每次我想拉取或推送存储库时,我都会收到此错误:

enter code hereremote: Repository not found.
fatal: repository 'https://github.com/Organisation/Repository.git/' not found

与我合作的所有存储库和客户端都是一样的。即使使用新创建的私人存储库。

创建新存储库时我的工作流程是

  1. 在 Github 网站上添加存储库并将其设置为私有
  2. 将我的 Github 帐户添加为协作者
  3. 在终端上切换到我的存储库文件夹。
  4. git init
  5. git remote add origin https://CopiedLinkToPrivateRepo
  6. git add .
  7. git commit -m 'my message'
  8. git push origin master
  9. 当 - 未找到存储库

该工作流程已经运行多年。直到几周前它突然停止工作了。

git github version-control terminal repository
2个回答
7
投票

感谢 CodeWizard。

对于所有寻找的人来说,似乎有两种解决方案。

  1. 使用 SSH 密钥提供凭据。否则无法找到私有存储库。无论出于何种原因,如果没有 ssh 密钥,Git 都不再要求提供凭据。
  2. 第二种方法是将您的用户名设置为远程网址。例如:
    git remote set-url https://[email protected]/usernameOrOrganisation/repository.git
    。 Github 网站有时似乎不提供带有用户名的链接。

0
投票

卸载并重新安装 git,一切都会正常工作。

© www.soinside.com 2019 - 2024. All rights reserved.