博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
git:致命的:无法从远程存储库读取
阅读量:3583 次
发布时间:2019-05-20

本文共 2829 字,大约阅读时间需要 9 分钟。

本文翻译自:

I am trying to set git up with to manage my site. 我正在尝试使用设置git来管理我的网站。

I have gotten to the last step in the instructions: git push website +master:refs/heads/master 我已经到达指示的最后一步:git push website + master:refs / heads / master

I am working using the git ming32 command line in win7 我正在使用Win7中的git ming32命令行

$ git push website +master:refs/heads/masterBill@***.com's password:Connection closed by 198.91.80.3fatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.

One problem here may be that the program is looking for Bill@***.com. 这里的一个问题可能是该程序正在寻找Bill@***.com。 when I connect via ssh to my site I have a different username( lets say 'abc'). 当我通过ssh连接到我的网站时,我使用了另一个用户名(可以说'abc')。 so maybe this should be abc@***.com. 所以也许应该是abc@***.com。 If so I don't know how to change this or if I can push under an alias 如果是这样,我不知道该如何更改,或者我是否可以使用别名进行推送


#1楼

参考:


#2楼

You can specify the username that SSH should send to the remote system as part of your remote's URL. 您可以指定SSH应该作为远程URL的一部分发送到远程系统的用户名。 Put the username, followed by an @ , before the remote hostname. 在远程主机名前放置用户名,后跟@

git remote set-url website abc@***.com:path/to/repo

#3楼

In your .git/config file 在您的.git / config文件中

[remote "YOUR_APP_NAME"]    url = git@heroku.com:YOUR_APP_NAME.git    fetch = +refs/heads/*:refs/remotes/YOUR_APP_NAME/*

And simply 并且简单地

git push YOUR_APP_NAME master:master

#4楼

After doing some research I've finally got solution for this, you have declared a environment variable to plink.exe path. 经过研究,我终于找到了解决方案,您已将环境变量声明为plink.exe路径。 So if you remove that path, reopen the git bash and try cloning through SSH it will work. 因此,如果删除该路径,请重新打开git bash并尝试通过SSH克隆将起作用。

Refer to this link 参考此链接


#5楼

Make sure you have correct url in .git/config 确保.git/config网址正确

url = git@github.com:username/repo.git

If it's your first push, you'll need to set up correct upstream 如果这是您的第一个建议,则需要设置正确的上游

$ git push -u origin master

You can check which key is used by: 您可以通过以下方式检查使用哪个密钥:

$ ssh -vvv git@github.com

The reply should contain something like this: 答复应包含以下内容:

debug1: Next authentication method: publickeydebug1: Offering RSA public key: ~/.ssh/id_rsa...You've successfully authenticated, but GitHub does not provide shell access.

Also it's possible to define rules for ssh in ~/.ssh/config , eg based on aliases: 也可以在~/.ssh/config为ssh定义规则,例如基于别名:

Host github      HostName github.com       User git      IdentityFile "~/.ssh/id_rsa"   Host git      HostName github.com       User git      IdentityFile "~/.ssh/some_other_id"

You can set connect to different ports, use different username etc. for each alias. 您可以设置连接到不同的端口,为每个别名使用不同的用户名等。


#6楼

Try removing the GIT_SSH environment variable with unset GIT_SSH . 尝试使用未unset GIT_SSH删除GIT_SSH环境变量。 This was the cause of my problem. 这是我问题的原因。

转载地址:http://nmlgj.baihongyu.com/

你可能感兴趣的文章
MyBatis(七) 解决resultMap只返回一条结果的问题
查看>>
GOF(一) 代理模式(Proxy pattern)
查看>>
web面试题整理
查看>>
MyBatis+Spring+SpringMVC框架面试题整理(一)
查看>>
MyBatis+Spring+SpringMVC框架面试题整理(二)
查看>>
MyBatis面试题 如何构建一个线程安全的SqlSession
查看>>
Java 面试题整理(一)
查看>>
Java 面试题整理(二)
查看>>
实现:JDK动态代理和CGLIB动态代理
查看>>
Java 面试题整理(三)
查看>>
MyBatis+Spring+SpringMVC框架面试题整理(三)
查看>>
Java 面试题整理(四)
查看>>
MySQL面试题
查看>>
Windows10 安装DB2数据库
查看>>
db2 解决load数据时报row found on wrong partition
查看>>
Spring Boot 使用 druid-spring-boot-starter 整合druid
查看>>
牛客 - Java专项练习题知识点整理(一)
查看>>
牛客 - Java专项练习题知识点整理(二)
查看>>
牛客 - Java专项练习题知识点整理(三)
查看>>
牛客 - Java专项练习题知识点整理(四)
查看>>