我有一个非常奇怪的问题与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和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
什么好主意吗?
当前回答
我在一台MAC上遇到了同样的问题,试图从我以前连接到的一个私人回购中提取。
我通过在回购url中包含我的用户名来解决这个问题:
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
它会提示你输入那个账户的密码,然后你就可以去了。
其他回答
我的解决方案可能对你们中的一些人有用。
我把笔记本电脑的操作系统更新到优胜美地后,也出现了同样的错误。通过重新创建ssh密钥,我的问题得到了解决。您可以通过执行本页的第2步完成此操作:https://help.github.com/articles/generating-ssh-keys/
Normally it happens because the project is private and you have not rights to write it. I had the same "problem" a few times, and it was for that reason. If the project it is yours, just create a private and a public key following this link: https://docs.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent and add them to the "SSH and Key" section on gitHub, then you will be able to push to the repo. In the other hand if the project it is not your, ask the owner to give you the rights for it.
我用的是Mac,我努力寻找解决方案。 我的远程地址是正确的,如前所述,这是一个证书问题。 显然,过去我在我的电脑上使用了另一个Git帐户,mac的钥匙链记住了前一个帐户的凭据,所以我真的没有被授权推送。
如何修复? 在mac上打开钥匙链访问,选择“所有项目”类别并搜索git。 删除所有找到的结果。
现在去终端再按一次。终端会要求输入用户名和密码。输入新的相关凭证,就是这样!
希望它能帮助到别人。我挣扎了几个小时。
我可以解释我是如何陷入类似的情况,然后列出我已经采取的步骤来解决这个问题。
我在用 Windows 10, Git: Git版本2.27.0.windows.1。
我已经安装了git,正在做git推送活动。Windows凭据管理器存储用户名和密码,所以你不必每次git远程活动都输入用户名和密码。
遇到这个问题,当我添加了另一个github帐户和使用——本地git设置。几天后,我遇到了存储库找不到的问题,经过调查我发现:
即使你从Windows凭证管理器中删除了git详细信息,它也会再次保存你输入的用户名、电子邮件详细信息。
因此,如果您使用两个git帐户,则需要使用(以管理员身份使用git bash)
git config --edit --system
然后移除
helper = manager
行,使其不再注册为凭据帮助器。但是每次你进行远程活动时,它都会询问你登录的详细信息。
如何禁用Git凭证管理器的Windows?
检查远程源、用户详细信息
git config --list --show-origin
这也可能发生,因为GitHub本身宕机了。一定要检查stat.github.com,看看问题是否在他们那边。
2018年10月22日,你有好几个小时都无法推送到GitHub。