如何修复 Git 错误(未找到存储库)?

How to Fix Git Error (Repository not found)?

我从 github 切换到 bitbucket。我没有做理性的事情,只是导入文件,而是在 github.

上删除了它们

这是我执行的步骤,但它们不起作用。

$ git remote add origin git@bitbucket.org:RallyWithGalli/personalcontrolcenter.git

fatal: remote origin already exists.

因为它已经存在,所以我进入下一步。

$ git push -u origin --all

ERROR: Repository not found. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

我不知道如何修复这个错误。如果可以轻松完成,我希望能够删除 git 中的所有内容并从头开始。

$ git remote add origin git@bitbucket.org:RallyWithGalli/personalcontrolcenter.git

fatal: remote origin already exists.

Git 告诉您的是,远程 命名的 origin 已经存在,但不一定具有相同的 URL。在您的情况下,它仍然指向您的 Github 存储库。由于您删除了它,因此当您尝试推送时,您会得到 repository not found.

我建议的程序是 重命名 而不是删除 Git 集线器远程(即原点)。这将保留 Github 存储库的内容,以防万一迁移到 Bitbucket 不顺利。然后将 Bitbucket 作为你的来源并推送。

  • git 远程重命名 origin github
  • git远程添加源git@bitbucket.org:RallyWithGalli/personalcontrolcenter.git
  • git 推送原点 --all