在学习git遇到的一些问题及解决方法

由于到公司实习,让我们了解一下git.于是开始了艰难的学习之路
基本步骤都是参照廖雪峰大大的教程
这里写图片描述
但是在添加远程库的时候,遇到了问题
git remote add origin 你自己的远程库url
执行这一步没有问题
git push -u origin master
报错:ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
然后上网百度解决方案
发现自己没有在远程库中增加自己的sshkey
按照网上的操作添加了之后不行
尝试连接git
$ ssh -T git@github.com

报错:ssh: connect to host github.com port 22: Connection timed out
尝试网上的另一种方法,在命令行ping github,连接超时,于是按照方法在host中添加了git的ip地址
再次执行 $ ssh -T git@github.com
成功了
The authenticity of host ‘github.com (13.229.188.59)’ can’t be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘github.com,13.229.188.59’ (RSA) to the list of known hosts.
Hi qiqiliuqiqi! You’ve successfully authenticated, but GitHub does not provide shell access.
然而在执行push的时候仍然报错。尝试了各种方法都无法解决。
最后把以太网关了改用无线网成功了
不太清楚原理
push成功提示:
Counting objects: 6, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (6/6), 461 bytes | 0 bytes/s, done.
Total 6 (delta 0), reused 0 (delta 0)
Branch master set up to track remote branch master from or.
To https://github.com/qiqiliuqiqi/gittest.git
* [new branch] master -> master
push成功之后的github
这里写图片描述
折腾了半天终于成功了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值