我有一个非常奇怪的问题与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
什么好主意吗?
当前回答
如果使用私有存储库检查连接用户,则该用户必须具有使用存储库的权限。
其他回答
问题:由于某些原因,Github不熟悉你的存储库。
Error:在git cli中提示如下:
remote:未找到存储库。致命:库 “https://github.com/MyOrganization/projectName.git/”未找到
解决方案:2个选项
Github might not familiar with your credentials: - The first Option is to clone the project with the right credentials user:password in case you forgot this Or generate ssh token and adjust this key in your Github. aka git push https://<userName>:<password>@github.com/Company/repositoryName.git Repo Permissions Issue with some users - In my Use case, I solved this issue when I realized I don't have the right collaborator permissions on Github in my private repo. Users could clone the project but not perform any actions on origin. In order to solve this:
去Github上的仓库->设置->合作者和团队->添加 成员/维护你的用户->现在他们获得了提交的权限 ,推动
如果你使用https从github克隆,但你使用ssh推送,你也会得到这个错误。
要纠正这个问题,打开.git/config并替换:
Url = https://github.com/company/project.git
With
Url = git@github.com:company/project.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上创建空的回购,然后再推到它。哎!包括这个给那些没意识到的人。
如果你的repo之前工作正常,突然弹出这个错误,最有可能的原因是你的git被认证为其他用户,没有访问存储库的权限。因此,为了进行推送,您所需要做的就是在git命令中指定正确的用户名和密码。所以,一个github回购的推命令看起来像:
git push https://youruser:password@github.com/user/reponame.git
用户名和密码需要进行url转义,因此@应该被%40取代,等等。