Git 升级与基础适用

Git 升级

  • 老方法

    yum install git 
    目前centos6安装的 git 版本为1.7相对于 github 以及自己安装的 git 服务器都相对比较老,所以一般不适用此方法安装)
  • 编译安装

    1.yum update 安装系统更新
    2.yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker 安装依赖包
    3.download git (git clone https://github.com/git/git.git Or wget https://github.com/git/git/archive/v2.3.0.zip)
    4.install git 
    -----------------------1--------------------
        #git clone https://github.com/git/git.git
        #cd git
        #git checkout 版本(可以适用 git tag 获取)
        #make prefix=/usr/local/git all
        #make prefix=/usr/local/git install
        #vim /etc/profile (将新的 git 写人全局变量)
            export PATH=/usr/local/git/bin:$PATH
        #source /etc/profile
    -----------------------end--------------------
    -----------------------2----------------------
        #wget https://github.com/git/git/archive/版本.zip
        #unzip 版本.zip
        #cd 版本.zip
        #make prefix=/usr/local/git all
        #make prefix=/usr/local/git install
        #vim /etc/profile (将新的 git 写人全局变量)
            export PATH=/usr/local/git/bin:$PATH
        #source /etc/profile
    -----------------------end----------------------

Git使用方法

clone 一个空的版本库是使用

Git global setup(首先配置全局用户名)
------------------------------------------
git config --global user.name "EdwardLiu"
git config --global user.email "lonnyliu@126.com"
------------------------------------------

Create a new repository(克隆远程版本库到本地)
------------------------------------------

git clone http://gitlab.custom.com/liuyulong/Script.git (克隆)
cd Script
touch README.md
git add README.md (缓存到本地)
git commit -m "add README" (增加提交信息)
git push -u origin master (推送到远程服务器)
------------------------------------------
posted @ 2016-01-21 16:43  Edward.Liu  阅读(213)  评论(0编辑  收藏  举报