Git使用——与github共舞01

Git基本使用
1.$mkdir Git
2.$git config --global user.name"小伙伴自己的用户名哈"
   $git config --global user.email"小伙伴自己的邮箱0.0"
3.$git init
4.$ssh-keygen -t rsa -C 小伙伴自己的@自己的.com   之后不断enter
5.$xclip -sel c ~/.ssh/id_rsa.pub   复制后添加到github
6.$新建 仓库,不要点初始化,
7.$根据提示
echo "# ×××××××" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:******/******.git
git push -u origin master
8.$
The authenticity of host 'github.com (***.***.***.***)' can't be established.RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'github.com,***.***.***.***' (RSA) to the list of known hosts.sign_and_send_pubkey: signing failed: agent refused operationPermission denied (publickey).fatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.
9.接下来按照知乎大佬的方法抢救一下0.0奋斗对公钥或者秘钥进行权限降级处理:
首先,清除所有的key-pair
9.01 $ssh-add -D
9.02 $rm -r ~/.ssh
9.03 删除你在github中的public-key
重新生成ssh密钥对
9.04 $ssh-keygen -t rsa -C "xxx@xxx.com"
9.05 $chmod 0700 ~/.ssh
9.06 $chmod 0600 ~/.ssh/id_rsa*

接下来正常操作在github上添加公钥public-key:
9.07首先在你的终端运行
$xclip -sel c ~/.ssh/id_rsa.pub将公钥内容复制到剪切板
2、在github上添加公钥时,直接复制即可
3、保存
测试:在终端 ssh -T git@github.com
作者:段海宁链接:https://www.zhihu.com/question/21402411/answer/42836492来源:知乎
10.然而。。。The authenticity of host 'github.com (***.***.***.***)' can't be established.RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'github.com,***.***.***.***' (RSA) to the list of known hosts.sign_and_send_pubkey: signing failed: agent refused operationPermission denied (publickey).
11.$eval "$(ssh-agent -s)"
12.$ssh-add
13.$ssh -T git@github.com

14.重启

15.OK奋斗

   
       
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值