我有一个非常奇怪的问题与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检查你有写访问权。
其他回答
在执行此操作之前,请确保您拥有对回购的写权限。如果您仍然得到错误,请执行以下操作:
Generate a personal access token from your account from Settings > Developer Settings > Personal Access tokens. Keep the token safe somewhere. Go to your repository and run the following: git remote rm origin Then add a new origin along with your username: git remote add origin https://USERNAME@github.com/REPOSITORY_LINK.git Now when you push the code, a prompt will show up asking for your password or personal access token. Paste the token that we generated in the first step in the field, and we're done.
转到你的项目文件夹,然后搜索。git文件夹,然后用记事本打开配置文件,检查是否有你的链接到github回购下:[remote "origin"],如果它是不同的,然后在你的github回购,然后编辑它,或在配置文件中打开一个新的回购名称
如果有人在github.com上遇到这个问题,检查你是否接受了回购所有者允许提交给你的邀请。直到你接受邀请,回购将是无形的为您。所以你会得到ERROR: Repository not found。
我也遇到了同样的问题,尝试了很多方法,但最后,我知道我没有足够的权限来推或拉这个回购,还有一种方法来检查你是否有权限,你无法看到该回购中的设置选项,如果你有权限,那么你将能够看到设置选项
谢谢!这是我观察到的
在我的情况下,这是由git使用错误的ssh私钥引起的。 我在学校使用的特定github用户帐户下获得了访问存储库的权限。我的默认ssh私钥不幸链接到不同的github帐户。
如果您使用ssh -T git@github.com ssh将自动使用您的id_rsa私钥连接到github。
使用ssh -i ~/。ssh/<some-key> -T git@github.com应该导致github欢迎您与您链接到该密钥的帐户。
所以在我的情况下发生的是,git正在使用我的默认ssh私钥,该私钥链接到错误的github帐户,该帐户没有访问我试图访问的私有存储库。
为了解决这个问题,我告诉git使用正确的ssh命令在本地git配置我的repo使用命令:git config core。ssh -i ~/.使用实例Ssh /<正确的私钥here>"
查看git配置git config -l应该显示行被正确添加。