git入门

来源:互联网 发布:js clientx undefined 编辑:程序博客网 时间:2024/06/06 10:07
详细的基础介绍:推荐学习廖雪峰的git教
这里对添加远程库这一小结里遇到的问题说明,把本地库推送远程库(github),当在执行推送命令的时候,报以下的error
[clef@localhost Clef_testing]$ git push -u origin masterssh: connect to host github.com port 22: Connection timed outfatal: Could not read from remote repository.Please make sure you have the correct access rightsand 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 masterfatal: 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
原创粉丝点击