简体   繁体   English

远程 GIT 推送失败:未找到存储库

[英]GIT push fails with remote: Repository not found

When I push files from the local to the remote I am gettting the error, " fatal: repository '' not found ".当我将文件从本地推送到远程时,出现错误“致命:存储库''未找到”。 Ths is occuring from both the TortoiseGit->Push and the Power shell command line.这发生在 TortoiseGit->Push 和 Power shell 命令行中。 The Tortoise push gives same error but then adds, " git did not exit cleanly (exit code 128) " All other commands appear to be working (cloning from remote, adding files and commiting). Tortoise 推送给出了相同的错误,但随后添加了“ git 没有完全退出(退出代码 128) ”所有其他命令似乎都在工作(从远程克隆、添加文件和提交)。 I have fellow coworkers where this is working as expected, and my permissions on GITHub appear to be the same.我有同事按预期工作,我对 GITHub 的权限似乎相同。 I have looked on other Stack Overflow questions and cannot find one that helps.我查看了其他 Stack Overflow 问题,但找不到有帮助的问题。

Git remotes generally have one location to fetch (used by pull and clone) and push, but they can be different. Git 远程通常有一个位置来获取(由 pull 和 clone 使用)和推送,但它们可以不同。 Since you can clone (fetch), but not push, it's possible these have diverged somehow.由于您可以克隆(获取),但不能推送,因此它们可能以某种方式发生了分歧。

You can check with git remote -v .您可以使用git remote -v进行检查。 You should see something like this.你应该看到这样的东西。

$ git remote -v
origin  git@github.com:rails/rails.git (fetch)
origin  git@github.com:rails/rails.git (push)

Here I'm using an example of the Github Rails repository.这里我使用的是 Github Rails 存储库的示例。 Both fetch and push are the same. fetch 和 push 都是一样的。 If they're different that's likely your problem.如果它们不同,那可能是您的问题。

This could be because you have remote.pushDefault or other remote.* configuration values set.这可能是因为您设置了remote.pushDefault或其他remote.*配置值。 Other possibilities are a broken http.proxy .其他可能性是损坏的http.proxy git config --list --show-origin will show you all your config settings and where they come from. git config --list --show-origin将显示您所有的配置设置以及它们的来源。 Look for anything fishy.寻找任何可疑的东西。

Another possibility is that you have permission to fetch, but not push, and your Git server is communicating a permissions problem incorrectly.另一种可能性是您有获取权限但没有推送权限,并且您的 Git 服务器错误地传达了权限问题。 Though as this is Github I doubt it.虽然这是 Github,但我对此表示怀疑。


All other commands appear to be working (cloning from remote, adding files and committing)所有其他命令似乎都在工作(从远程克隆、添加文件和提交)

Side note: Most operations in Git are happening entirely on your local machine.旁注:Git 中的大多数操作完全在您的本地机器上进行。 The only relevant commands are git clone , git fetch , git push , and git pull .唯一相关的命令是git clonegit fetchgit pushgit pull Commit, add, diff, log, rm, etc... are happening locally.提交、添加、差异、日志、rm 等...都在本地发生。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM