首页 > 其他 > 详细

Git 升级与基础适用

时间:2016-01-21 18:34:45      阅读:179      评论:0      收藏:0      [点我收藏+]

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 (推送到远程服务器)
------------------------------------------

Git 升级与基础适用

原文:http://www.cnblogs.com/edwardlogs/p/5148803.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!