Your identification has been saved in /Users/you/.ssh/id_rsa.
# Your public key has been saved in /Users/you/.ssh/id_rsa.pub.
cd ~/.ssh
查看公钥
cat id_rsa.pub
复制粘贴到码云上
到本地项目文件夹下,右键点击空白处,选择Git Bash Here,进入git窗口
一波操作后的页面
whereis git
yum install -y git
git version
eg: cd /home/www/test
git init
git config --global user.name "您的用户名称"
git config --global user.email "您的邮箱地址"
git remote add origin 自己的仓库地址
eg:git remote add origin https://gitee.com/***/**.git
ssh -v git@gitee.com
然后输入 yes
我拉取的是master分支
git pull origin master
如果拉文件的时候报这个错误,那么我们需要生成ssh公钥
ssh-keygen -t rsa -C"xxxxx@xxxxx.com"
查看当前公钥,并且将公钥添加到码云后台的ssh公钥中
git branch --set-upstream-to=origin/码云本地分支 服务器本地分支
eg:git branch --set-upstream-to=origin/master master
git config --global credential.helper store
到此、配置完成
ssh链接git服务器,解决Agent admitted failure to sign using,错误信息如下:
Agent admitted failure to sign using the key.
git@git.oschina.net 's password:
Permission denied, please try again.
git@git.oschina.net 's password:
Permission denied, please try again.
git@git.oschina.net 's password:
Permission denied (publickey,password,keyboard-interactive).
fatal: Could not read from remote repository.
原因是ssh-agent服务没把新产生的/home/you/.ssh/id_rsa 包含进去,解决方法如下:
eval "$(ssh-agent -s)"
ssh-add
如果你的私钥文件已经改名,不是默认的id_rsa,请输入你的正确的私钥文件路径:
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/my_other_key
欢迎分享,转载请注明来源:夏雨云
评论列表(0条)