Git推送错误:找不到存储库

Git推送错误:找不到存储库,git,github,git-push,Git,Github,Git Push,我对git和github有一个非常奇怪的问题。当我尝试推动时,我得到: git push -u origin master ERROR: Repository not found. fatal: The remote end hung up unexpectedly 我添加了遥控器: git remote add origin git@github.com:account-name/repo-name.git 有什么想法吗?检查您是否有读写权限 Git错误消息具有误导性。我也有类似的问题。我

我对
git
github
有一个非常奇怪的问题。当我尝试推动时,我得到:

git push -u origin master
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly
我添加了遥控器:

git remote add origin git@github.com:account-name/repo-name.git

有什么想法吗?

检查您是否有读写权限

Git错误消息具有误导性。我也有类似的问题。我已被添加到现有的项目中。我克隆了它并进行了本地更改。我去推送,得到了
错误:未找到存储库。
错误消息


将我添加到项目的人授予我对存储库的只读访问权限。他们做了一个改变,我就可以推了。

我也遇到了同样的错误

ERROR: Repository not found.   
fatal: The remote end hung up unexpectedly
我在Github上创建了存储库,并在本地克隆了它

我可以通过打开.git/config并删除
[remote“origin”]
部分来解决这个问题

[remote "origin"]   
   url = git@github.com:alexagui/my_project.git  
   fetch = +refs/heads/*:refs/remotes/origin/*
然后我(再次)运行以下命令


这一次,我能够推送到存储库。

更改.git/config文件的内容有助于实现上述功能。我遇到了同样的问题,我想这是因为我更改了我的Github用户名。无法使用更改更新本地文件。所以,也许在你改变用户名的时候,你可以考虑运行< /P>
git-remote-add-origin-your\u-ssh\u-link\u-from\u-github


我希望这有帮助;)

我也有同样的问题。我的问题是误解了我必须先在github上创建空回购协议,然后再推动它。啊!在这里为没有意识到这一点的其他人提供这一信息。

我遇到了这个错误(但在工作之前)。我的问题是缺少与Github帐户绑定的ssh密钥。您可以使用
ssh add-l
检查当前ssh密钥

如果您的密钥丢失,您可以将其添加到

ssh-add ~/.ssh/your_key

他也有类似的问题。问题的根源在于,我遵循了一些关于向Github添加新存储库的在线教程

只需转到Github,创建一个新的回购协议,它会要求您添加自述,不要添加它。创建它,您将获得有关如何推送的说明

它类似于下面两行:

git remote add origin https://github.com/YOUR_USER/your-repo.git
git push -u origin master

我遇到了同样的问题,我通过在回购url中包含我的用户名和密码解决了这个问题:

git clone https://myusername:mypassword@github.com/path_to/myRepo.git
git remote set-url origin https://<YOUR_USER_NAME_HERE>@github.com/<YOUR_USER_NAME_HERE>/<REPO>.git
git远程rm源
git远程添加源

您需要检查SSH访问,如下所示:

ssh -T git@github.com

这个问题是因为我没有在存储库中添加SSH上的person响应,请阅读有关SSH的更多信息。

也遇到了同样的问题。多年来,一切都运转良好,然后突然出现了这个错误

问题是,我在用户的github SSH密钥(我总是使用它访问有问题的repo)之前,向SSH代理添加了另一个repo的部署密钥。SSH代理首先尝试了另一个repo的部署密钥,GitHub出于完全无法解释的原因说

ERROR: Repository not found.

一旦我从SSH代理中删除了部署密钥,一切都恢复正常。

我遇到了这个问题,并意识到我使用的是一个不同于其repo帐户的帐户。以原始用户身份登录解决了问题。

如果您属于Github中的某个组,请检查您是否具有写入权限

我也有类似的问题。OS X的密钥链中缓存了不正确的凭据


签出:

以下内容为我解决了问题

首先,我使用这个命令来计算github帐户使用了什么:

ssh -T git@github.com
这给了我这样一个答案:

Hi <github_account_name>! You've successfully authenticated, but GitHub does not provide shell access. I just had to give the access to fix the problem.
你好!您已成功通过身份验证,但GitHub不提供shell访问。我只需要给你解决问题的权限。
然后我了解到答案中描述的Github用户(Github\u帐户\u名称)在我试图获取的Github存储库中未获得授权。

如果有人在Github.com上遇到此问题,请检查您是否在回购所有者允许向您提交后接受了邀请。在你接受邀请之前,回购对你来说是不可见的。因此,您将得到
错误:未找到存储库。
这解决了我的问题

   git pull https://myusername:mypassword@github.com/path_to/myRepo.git

下面是如何解决我的问题

#check current github account
ssh -T git@github.com

#ensure the correct ssh key used with github
ssh-agent -s
ssh-add ~/.ssh/YOUR-GITHUB-KEY

#re-add the origin
git remote add origin git@github.com:YOUR-USER/YOUR-REPO.GIT
git push -u origin master

我也有同样的问题,私人回购

请执行以下操作:

移除远程原点

git remote rm origin
重新添加来源,但使用您的用户名和在本pvt回购上具有写入权限的pwd

git remote add origin  https://USERNAME:PASSWORD@github.com/username/reponame.git

这就是我的工作原理:

1。遥控器

$ git remote rm origin
$ git remote add origin git@github.com:<USER>/<REPO>.git
3。在SSH代理级别添加密钥

$ eval "$(ssh-agent -s)"
$ ssh-add ~/.ssh/id_rsa_github

4。将新密钥添加到Github repo。

我也遇到了同样的问题。请尝试以下操作:

1.在Mac中修改git凭据的密钥链访问解决了我的问题
2.重置源url

git remote rm origin
git remote add origin git@github.com:account-name/repo-name.git

有一个问题,对于一些我在这里没有提到的人来说可能是显而易见的,可能是您可以使用ssh密钥进行访问,但您正在尝试通过https将本地repo连接到远程

如果是这种情况,则以下命令应为您解决此问题:

$ git remote -v
origin  https://github.com/private-repo.git (fetch)
origin  https://github.com/private-repo.git (push)
$ git remote rm origin
$ git remote add origin git@github.com:private-repo.git
$ git remote -v
origin  git@github.com:private-repo.git (fetch)
origin  git@github.com:private-repo.git (push)
请注意,上述工作假设:

  • 您当前的遥控器名为
    origin
    ,并且您已经有了 生成的ssh密钥已连接到github帐户

  • 您已经有一个与github帐户关联的ssh密钥(并在本地连接)

  • 您在github上为此回购设置设置了正确的权限(读/写)


  • 我正在使用Mac,我很难找到解决方案。 我的远程地址是正确的,如前所述,这是一个凭证问题。 显然,过去我在我的电脑上使用了另一个Git帐户,mac的钥匙链记住了前一个帐户的凭证,所以我真的没有授权推送

    如何修复? 在mac电脑上打开钥匙链访问,选择“所有项目”类别并搜索git。 删除找到的所有结果

    现在转到终端并再次尝试按下。终端将要求输入用户名和密码。输入新的相关凭证,就这样

    git remote rm origin
    git remote add origin git@github.com:account-name/repo-name.git
    
    $ git remote -v
    origin  https://github.com/private-repo.git (fetch)
    origin  https://github.com/private-repo.git (push)
    $ git remote rm origin
    $ git remote add origin git@github.com:private-repo.git
    $ git remote -v
    origin  git@github.com:private-repo.git (fetch)
    origin  git@github.com:private-repo.git (push)
    
    % git remote add ssh git@github.com:our-organisation/some-repository.git
    
    % git fetch ssh
    From github.com:our-organisation/some-repository
    * [new branch]        MO_Adding_ECS_configs             -> ssh/MO_Adding_ECS_configs
    * [new branch]        update_gems                       -> ssh/update_gems
    
    % git push ssh     
    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 push https://youruser:password@github.com/user/reponame.git
    
    git remote set-url origin https://<YOUR_USER_NAME_HERE>@github.com/<YOUR_USER_NAME_HERE>/<REPO>.git
    
    git clone https://<YOUR_USER_NAME_HERE>@github.com/<YOUR_USER_NAME_HERE>/<REPO>.git    
    
    git config --edit --system 
    
    helper = manager 
    
    git config --list --show-origin