我在Mac Snow Leopard上,我刚刚安装完毕git.
我刚试过
git clone git@thechaw.com:cakebook.git
Run Code Online (Sandbox Code Playgroud)
但这给了我这个错误:
Initialized empty Git repository in `/Users/username/Documents/cakebook/.git/`
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
Run Code Online (Sandbox Code Playgroud)
我错过了什么?
我也尝试过ssh-keygen没有passphase,但仍然是同样的错误.
我正在尝试在我的Windows XP机器上配置GIT,但SSH一直在非感性的地方创建和查找公钥/私钥对,例如/.ssh/id_rsa
在GIT安装Windows中是否有配置文件,我可以将其切换到我的主目录或其他用户定义的位置?默认情况下,它提供了在//.ssh/id_rsa创建新密钥对,但这给了我错误"无法创建目录'//.ssh'." 当我能够找到一个可以创建它的目录时,GIT就不会看到它.
我试图在我的共享Linux服务器上使用部署php脚本,使用他们的web-hooks功能从github.com获取一个私人仓库,这是第一次使用ssh.
本质上:每次我提交github web-hook发送一个post请求到我的php文件,我想用它来发出一个简单的git pull命令,从而保持我的服务器和github同步并意味着我有一个体面的工作流程,将帮助我停止在生产服务器上编辑内容.
我正在使用终端进行ssh连接.
我使用ssh去我的服务器并创建我的私人仓库的克隆,这很有用.
因此,我可以ssh到我的服务器并发出一个git pull完美的工作.但当然我想自动化这个过程.如果我可以让这个工作,我想对其他几个回购做同样的事情.
我已经关注创建密钥并将其添加到github.com上我的帐户部分的github指南,我可以看到密钥存在于我的主机上的/.ssh/文件夹中.私钥有chmod 600,公钥是644.我删除了这些,重新创建了新密钥,并在github上删除/重新添加了几次公钥.ssh keys
我目前有这些键:
1024 03:c4:16:45:40:77:a4:94:a4:... /home/username/.ssh/id_dsa (DSA)
2048 b3:62:87:e0:4b:39:aa:06:97... /home/username/.ssh/id_github (RSA)
Run Code Online (Sandbox Code Playgroud)
我有一个带有以下内容的/.ssh/config文件(希望github使用基于此SO答案的id_github密钥:
# Default GitHub
Host github_server
HostName github.com
user git
ForwardAgent yes
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_github
Run Code Online (Sandbox Code Playgroud)
我已更新我的.git/config以将命令更改为 git@github_server:username/repo
我已经使用了将密钥复制到authorized_keys
cat id_github.pub >> authorized_keys
Run Code Online (Sandbox Code Playgroud)
但是当我提交时,我收到一封电子邮件说permissions denied (publickey)(我的php脚本会发送成功/失败的电子邮件,并且基于此回购:
这使用了一个简单git pull的shell_exec函数,我已添加2>&1到最后进行调试.
我将命令更改为(尝试为用户添加密钥)
`ssh-add …Run Code Online (Sandbox Code Playgroud) 嗨,我正在关注rails应用程序的初学者教程.但我在推送存储库时遇到了问题.每次我正在做和git push -u到origin master我有这个错误.
guinslym@ubuntu:~/Documents/rails_tuto/first_app$ git remote add origin https://github.com/guinslym/first_app.git
fatal: remote origin already exists.
guinslym@ubuntu:~/Documents/rails_tuto/first_app$ git push -u origin master
Warning: Permanently added the RSA host key for IP address '192.30.252.130' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
guinslym@ubuntu:~/Documents/rails_tuto/first_app$
guinslym@ubuntu:~/Documents/rails_tuto/first_app$ ssh -vT git@github.com
OpenSSH_5.9p1 Debian-5ubuntu1.1, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config …Run Code Online (Sandbox Code Playgroud)