我有一个非常奇怪的问题与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
什么好主意吗?
当前回答
我也遇到过同样的问题,是私人回购。
做以下几点:
移除远端原点
git remote rm origin
重新添加原点,但与您的用户名和PWD与写权限在这个PVT回购
git remote add origin https://USERNAME:PASSWORD@github.com/username/reponame.git
其他回答
下面为我解决了这个问题。
首先,我使用这个命令来确定使用的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存储库上没有授权。
我也有同样的问题。
我解决了把我的gitlab用户名前缀到gitlab.com url的问题,就像这样: 之前: https://gitlab.com/my_gitlab_user/myrepo.git 后: https://my_gitlab_user@gitlab.com/my_gitlab_user/myrepo.git 在这种情况下,将再次要求凭据,这就完成了!
步骤1:
从HTTPS复制链接
步骤2:
在本地存储库中
git remote rm origin
步骤3:
在复制的url中将github.com替换为username.password@github.com
步骤4:
git remote add origin url
这个答案是IntelliJ产品(如IDEA / WebStorm / PHPStorm)在使用组织时所特有的。
我有这个问题与WebStorm时,试图推动到一个存储库的一部分 一个组织,同时推送到我正常范围内的存储库 私人账户有效。 此外,用IntelliJ IDEA推送到我的组织存储库也起作用了
所以我认为这可能只是与两个ide之间的设置不同有关,我发现我在WebStorm中启用了“使用凭据助手”复选框,而在IDEA中禁用了。
禁用凭据助手使其工作!!
转到你的项目文件夹,然后搜索。git文件夹,然后用记事本打开配置文件,检查是否有你的链接到github回购下:[remote "origin"],如果它是不同的,然后在你的github回购,然后编辑它,或在配置文件中打开一个新的回购名称