git入门

详细的基础介绍:推荐学习 廖雪峰的git教
这里对添加远程库这一小结里遇到的问题说明,把 本地库推送远程库(github),当在执行推送命令的时候,报以下的error
[clef@localhost Clef_testing]$ git push -u origin master
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
意思就是连接超时了,可能是公司网络禁用了SSH的22端口导致的,所幸git提供了https、git、ssh三种协议来读写。运行 git config --local -e打开配置信息,修改其中的
url = git@github.com:username/repo.git

url = https://username@github.com/username/repo.git
修改过后还是遇到下面的问题
[clef@localhost Clef_testing]$ git push -u origin master
fatal: unable to access 'https://Clefgithub@github.com/Clefgithub/Clef_testing.git/': Failed connect to github.com:443; Connection timed out
因为公司里面要通过代理才可以访问外网,通过设置如下代理后即可成功推送本地库到远程库
export https_proxy=proxy_IP:proxy_port

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值