我有一个非常奇怪的问题与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
什么好主意吗?
当前回答
首先在命令行上创建一个新的存储库,命名为adim .git
在命令行上创建一个新的存储库
触摸README.md git init git添加README.md Git commit -m "第一次提交" git远程添加origin https://github.com/your_name/Ademo.git Git push -u origin master
从命令行推送现有存储库
git远程添加origin https://github.com/your_name/Ademo.git Git push -u origin master
其他回答
如果有人在github.com上遇到这个问题,检查你是否接受了回购所有者允许提交给你的邀请。直到你接受邀请,回购将是无形的为您。所以你会得到ERROR: Repository not found。
下面为我解决了这个问题。
首先,我使用这个命令来确定使用的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存储库上没有授权。
我也有同样的问题。试试下面的方法: 1. 修改密钥链访问在Mac的git凭证解决了我的问题。 2. 重置原始url
git remote rm origin
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
我用的是Mac,我努力寻找解决方案。 我的远程地址是正确的,如前所述,这是一个证书问题。 显然,过去我在我的电脑上使用了另一个Git帐户,mac的钥匙链记住了前一个帐户的凭据,所以我真的没有被授权推送。
如何修复? 在mac上打开钥匙链访问,选择“所有项目”类别并搜索git。 删除所有找到的结果。
现在去终端再按一次。终端会要求输入用户名和密码。输入新的相关凭证,就是这样!
希望它能帮助到别人。我挣扎了几个小时。