zoukankan      html  css  js  c++  java
  • 安装和使用git遇到的问题总结

    一,centos7下安装(因为centos7下用yum安装git的版本太低了,所以只能下载源代码,然后用源代码安装)

    下载编译工具 

    yum -y groupinstall "Development Tools"

    下载依赖包 
    yum -y install zlib-devel perl-ExtUtils-MakeMaker asciidoc xmlto openssl-devel

    下载 Git 最新版本的源代码 
    wget https://www.kernel.org/pub/software/scm/git/git-2.13.3.tar.gz

    4.解压 

    tar -zxvf git-2.11.0.tar.gz

    5、进入目录配置 

    cd git-2.13.3

    ./configure --prefix=/usr/local/git

    6.安装 

    make && make install

    7.配置全局路径 

    export PATH="/usr/local/git/bin:$PATH"

    source /etc/profile

    8.查看git版本 

    git --version

    二,遇到的问题

    问题1,

    git push -u origin master  

    提示错误:Unable to find remote helper for 'https'

     

    解决办法:

    1,rm -rf /usr/local/git/(自己机器上的GIT安装目录)

    2,yum install curl-devel

    3,重新安装git

     

    问题2,ubuntu下连不上github的问题

    ssh -v git@github.com

    上面的命令执行后,一直挺在下面的语句

    Connecting to ssh.github.com [192.30.253.123] port 22.

     

    解决办法:

    1,sudo gedit /etc/hosts

    添加下面的2行内容

    192.30.255.112 github.com git

    185.31.16.184 github.global.ssl.fastly.net

    2,编辑后,你需要重新启动一下你的网络。

    /etc/init.d/networking restart

    3,在~/.ssh目录下创建config文件,输入如下内容:

    Host github.com
    User xxx@163.com (你注册github时的邮箱,这里使用注册的用户名也行)
    Hostname ssh.github.com
    PreferredAuthentications publickey
    IdentityFile ~/.ssh/id_rsa
    Port 443

     

  • 相关阅读:
    多一盎司定律
    工作职场中,需要养成并实践的思维模型
    中国易经大师排名,易学十大泰斗人物
    大易人生 --- 曾老
    中道管理 --- 曾老
    大数据分析的道与术
    人应该服从自己的规划
    练习不是让你一次就把事情做好,而是帮助你做的越来越好
    让理想转个弯
    在酒桌上就能搞定生意
  • 原文地址:https://www.cnblogs.com/xiaoshiwang/p/9128282.html
Copyright © 2011-2022 走看看