我正试图用http://danielmiessler.com/study/git/#website设置git 来管理我的网站.
我已经完成了说明的最后一步:git push website + master:refs/heads/master
我正在使用win7中的git ming32命令行
$ git push website +master:refs/heads/master
Bill@***.com's password:
Connection closed by 198.91.80.3
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Run Code Online (Sandbox Code Playgroud)
这里的一个问题可能是程序正在寻找Bill@***.com.当我通过ssh连接到我的网站时,我有一个不同的用户名(让我们说'abc').所以也许这应该是abc@***.com.如果是这样,我不知道如何改变这个或者我是否可以推动别名
小智 135
您的ssh密钥很可能已从ssh代理中删除
ssh-add ~/.ssh/id_rsa
Run Code Online (Sandbox Code Playgroud)
其中id_rsa是与git repo关联的ssh密钥
rob*_*off 119
您可以指定SSH应作为远程URL的一部分发送到远程系统的用户名.@在远程主机名之前输入用户名,后跟an .
git remote set-url website abc@***.com:path/to/repo
Run Code Online (Sandbox Code Playgroud)
Tom*_*art 112
确保你有正确的网址 .git/config
url = git@github.com:username/repo.git
Run Code Online (Sandbox Code Playgroud)
如果这是你的第一次推动,你需要设置正确的上游
$ git push -u origin master
Run Code Online (Sandbox Code Playgroud)
您可以通过以下方式检查使用的密钥:
$ ssh -vvv git@github.com
Run Code Online (Sandbox Code Playgroud)
回复应包含以下内容:
debug1: Next authentication method: publickey
debug1: Offering RSA public key: ~/.ssh/id_rsa
...
You've successfully authenticated, but GitHub does not provide shell access.
Run Code Online (Sandbox Code Playgroud)
此外,还可以为ssh定义规则~/.ssh/config,例如基于别名:
Host github
HostName github.com
User git
IdentityFile "~/.ssh/id_rsa"
Host git
HostName github.com
User git
IdentityFile "~/.ssh/some_other_id"
Run Code Online (Sandbox Code Playgroud)
您可以设置连接到不同的端口,为每个别名使用不同的用户名等.
Man*_*kar 106
我刚才面临同样的问题......
我的.git/config了
url = git@github.com:manishnakar/polymer-demo.git
Run Code Online (Sandbox Code Playgroud)
我换了它
url = https://github.com/manishnakar/polymer-demo.git
Run Code Online (Sandbox Code Playgroud)
它现在有效:)
Bas*_*bin 13
这通常是由于SSH密钥与远程不匹配引起的.
解决方案:
转到终端并键入以下命令(Mac,Linux)替换为您的电子邮件ID.
ssh-keygen -t rsa -C"you@email.com"
使用以下命令从单词ssh开始复制生成的密钥.
cat~/.ssh/id_rsa.pub
For*_*ver 13
我有一个错误的 Bitbucket ssh 私钥以及正确的 ssh 代理。
首先删除所有键
ssh-add -D
Run Code Online (Sandbox Code Playgroud)
然后添加了正确的键。
ssh-add ~/.ssh/id_rsa
Run Code Online (Sandbox Code Playgroud)
小智 11
通过在终端上执行以下命令,确保ssh-agent正在运行:
eval $(ssh-agent -s)
Run Code Online (Sandbox Code Playgroud)
来源:Github文档
Shu*_*min 10
对我有用的非常简单的解决方案,请参见下文:-
$ git clone git@github.com:xxxxx/xxxx.git my-awesome-proj
Cloning into 'my-awesome-proj'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
Run Code Online (Sandbox Code Playgroud)
$ ssh -T git@github.com
ssh: connect to host github.com port 22: Connection timed out
Run Code Online (Sandbox Code Playgroud)
$ ssh -T -p 443 git@ssh.github.com
Hi xxxx! You've successfully authenticated, but GitHub does not provide shell access.
Run Code Online (Sandbox Code Playgroud)
$ vim ~/.ssh/config
# You can also manually open the file and copy/paste the section below
# Add section below to it
Host github.com
Hostname ssh.github.com
Port 443
Run Code Online (Sandbox Code Playgroud)
$ ssh -T git@github.com
Hi xxxxx! You've successfully authenticated, but GitHub does not
provide shell access.
Run Code Online (Sandbox Code Playgroud)
$ git clone git@github.com:xxxxxx/xxxxx.git my-awesome-proj
Cloning into 'my-awesome-proj'...
remote: Enumerating objects: 15, done.
remote: Counting objects: 100% (15/15), done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 15 (delta 0), reused 15 (delta 0), pack-reused 0
Receiving objects: 100% (15/15), 22.90 KiB | 4.58 MiB/s, done.
Run Code Online (Sandbox Code Playgroud)
参考:此处 =>使用 HTTPS 和端口 443
小智 8
在做了一些研究之后我终于得到了解决方案,你已经为plink.exe路径声明了一个环境变量.因此,如果您删除该路径,请重新打开git bash并尝试通过SSH克隆它将起作用.
请参阅此链接
http://sourceforge.net/p/forge/site-support/2959/#204c
我有同样的问题.
此错误表示您尚未指定代码将推送到的远程URL位置.
您可以通过2种(主要)方式设置远程URL:
通过在Git Bash上执行命令指定远程URL.
导航到您的项目目录
打开Git Bash
执行命令:
git remote set-url origin <https://abc.xyz/USERNAME/REPOSITORY.git>在配置文件中提及远程URL
导航到您的项目目录
移至.git文件夹
在文本编辑器中打开配置文件
复制并粘贴下面的行
[remote "origin"]
url = https://abc.xyz/USERNAME/REPOSITORY.git
fetch = +refs/heads/*:refs/remotes/origin/*有关更多详细信息,请访问此链接.
小智 6
我有同样的错误.解决方案如下:我已经纠正了我的网址.git/config.刚刚从HTTPS克隆URL复制了它.那将是这样的:
url = https://github.com/*your*git*name*/*your*git*app*.git
Run Code Online (Sandbox Code Playgroud)
有效.
小智 5
如果在“git push origin master”命令之后你看到错误“无法从远程存储库读取”然后试试这个
1.ssh-keygen -t rsa -b 4096 -C "youremail"
2.eval $(ssh-agent -s)
3.ssh-add ~/.ssh/id_rsa
4.clip < ~/.ssh/id_rsa.pub(it copies the ssh key that has got generated)
5.then go to your remote repository on github and goto settings-> SSH and GPG keys ->new SSH key ->enter any title and paste the copied SSH key and save it
6. now give git push origin master
Run Code Online (Sandbox Code Playgroud)
我面临着同样的问题。所以这就是我解决同样问题的方法
步骤1:
创建一个新的 ssh 密钥:-
ssh-keygen -t ed25519 -C "your_email@example.com"
Run Code Online (Sandbox Code Playgroud)
第2步:
将 ssh 密钥复制到剪贴板上:-
pbcopy < ~/.ssh/id_ed25519.pub
Run Code Online (Sandbox Code Playgroud)
步骤3:
现在将复制的 ssh 密钥粘贴到相应的 git 存储库
步骤 4: 在后台启动 ssh-agent。
$ eval "$(ssh-agent -s)"
> Agent pid 59566
Run Code Online (Sandbox Code Playgroud)
第 5 步: 现在尝试访问存储库
git clone git@github.com:username/repo-name.git
Run Code Online (Sandbox Code Playgroud)
第6步:
如果您仍然看到问题,请检查 ssh 配置文件
vim ~/.ssh/config
Run Code Online (Sandbox Code Playgroud)
内容应该是这样的
Host github.com
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_ed25519
Run Code Online (Sandbox Code Playgroud)
第7步:
将您的 SSH 私钥添加到 ssh-agent 并将您的密码存储在钥匙串中
ssh-add --apple-use-keychain ~/.ssh/id_ed25519
Run Code Online (Sandbox Code Playgroud)
步骤8:
现在再试一次应该可以了
git clone git@github.com:username/repo-name.git
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
934041 次 |
| 最近记录: |