zoukankan      html  css  js  c++  java
  • CentOS 6 安装 Git

    1. 安装 Git:

    # yum update    # 1.更新系统
    # yum install curl-devel expat-devel gettext-devel openssl-devel gcc perl-ExtUtils-MakeMaker    # 2.安装依赖包
    # 3.下载最新的 Git 源码并解压缩: https://www.kernel.org/pub/software/scm/git/
    # tar zxvf git-2.9.4.tar.gz
    # cd git-2.9.4
    # make prefix=/usr/local/git all    # 4.编译到指定目录
    # make prefix=/usr/local/git install    # 5.安装到指定目录
    # whereis git    # 6.查看 git 所在的路径
    # vim /etc/profile        # 7.把 git 路径放到环境变量中
    export PATH=/usr/local/git/bin:$PATH    
    # source /etc/profile
    # git --version    # 8.查看 git 版本
    

    2.设置 Git:

    $ pwd
    /home/centos
    $ git config --global user.name "Philly008"    # 设置用户名和 email
    $ git config --global user.email "liuup66@163.com"
    $ ls -a | grep .gitconfig    # 设置完成后会生成 .gitconfig 文件
    $ ssh-keygen -t rsa -C "liuup66@163.com"    # 创建 SSH Key,默认路径即可(一般是 ~/.ssh)
    $ cat ~/.ssh/id_rsa.pub    # 复制此文件内容到 Github>settings>SSH Key>Add SSH key 里面
    $ ssh -T git@github.com    # 测试链接是否成功
    

    3.为 Github 上的 Repository 提交修改:

    $ git clone https://github.com/Philly008/autotest.git
    $ cd ./autotest
    $ vim README.md
    $ git status
    $ git add README.md
    $ git commit -m "Edit by Centos 20170601"
    $ git remote add origin https://github.com/Philly008/autotest.git
    此时会报错:remote origin already exists.
    $ git remote rm origin
    $ git remote add origin https://github.com/Philly008/autotest.git
    $ git push -u origin master    # 提交完成后,查看 Github 上的 Repository 的更改。
    
  • 相关阅读:
    Object.defineProperty 监听对象属性变化
    Object.create(null) 和 {} 区别
    Vue 源码 基础知识点
    js setTimeout和setInterval区别
    Fiddler抓包工具使用方法
    使用 Jmeter 做 Web 接口测试
    Python 操作 SQL 数据库 (ORCAL)
    python连接MySQL数据库问题
    抓包工具Charles基本用法
    Python数据分析之pandas学习
  • 原文地址:https://www.cnblogs.com/liuliu3/p/6931436.html
Copyright © 2011-2022 走看看