我有一个非常奇怪的问题与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
什么好主意吗?
当前回答
如果你在vscode之前所有的东西都自动化了,现在它不再工作了,试着在vscode上注销你连接的github帐户,然后再登录到有权访问该存储库的正确的github帐户。
这里是你签出和签回的地方。
其他回答
我得到了同样的错误,因为我改变了我的github用户名,然后我这样做:
git remote -v
然后:
git remote set-url newname newurl
git push -u origin master
这次我能够推送到存储库。 我希望这能有所帮助。
我也遇到了同样的问题,尝试了很多方法,但最后,我知道我没有足够的权限来推或拉这个回购,还有一种方法来检查你是否有权限,你无法看到该回购中的设置选项,如果你有权限,那么你将能够看到设置选项
谢谢!这是我观察到的
如果您包括您的用户名和回购名称,我们可以合理地帮助您,目前我们没有理由认为回购确实存在。
此外,如果回购是私有的,并且您无法访问它,github将返回“不存在”,以避免披露私有回购的存在。
编辑:如果你不能克隆它,因为它说它不存在,它是私有的,这是因为你没有发送身份验证。确保您的公钥已添加到密匙环,或暂时使用HTTP基本身份验证。
下面为我解决了这个问题。
首先,我使用这个命令来确定使用的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用户(github_account_name)在我试图拉的Github存储库上没有授权。
我也遇到过同样的问题,是私人回购。
做以下几点:
移除远端原点
git remote rm origin
重新添加原点,但与您的用户名和PWD与写权限在这个PVT回购
git remote add origin https://USERNAME:PASSWORD@github.com/username/reponame.git