我有一个非常奇怪的问题与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
它会提示你输入那个账户的密码,然后你就可以去了。
其他回答
我也遇到了同样的问题,尝试了很多方法,但最后,我知道我没有足够的权限来推或拉这个回购,还有一种方法来检查你是否有权限,你无法看到该回购中的设置选项,如果你有权限,那么你将能够看到设置选项
谢谢!这是我观察到的
这个答案是IntelliJ产品(如IDEA / WebStorm / PHPStorm)在使用组织时所特有的。
我有这个问题与WebStorm时,试图推动到一个存储库的一部分 一个组织,同时推送到我正常范围内的存储库 私人账户有效。 此外,用IntelliJ IDEA推送到我的组织存储库也起作用了
所以我认为这可能只是与两个ide之间的设置不同有关,我发现我在WebStorm中启用了“使用凭据助手”复选框,而在IDEA中禁用了。
禁用凭据助手使其工作!!
我得到了同样的错误,因为我改变了我的github用户名,然后我这样做:
git remote -v
然后:
git remote set-url newname newurl
git push -u origin master
这次我能够推送到存储库。 我希望这能有所帮助。
我得到了同样的错误
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 remote add origin git@github.com:alexagui/my_project.git
git push -u origin master
这一次我可以推到存储库。
我也有同样的问题。试试下面的方法: 1. 修改密钥链访问在Mac的git凭证解决了我的问题。 2. 重置原始url
git remote rm origin
git remote add origin git@github.com:account-name/repo-name.git