zoukankan      html  css  js  c++  java
  • 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 (推送到远程服务器)
    ------------------------------------------
  • 相关阅读:
    mysql 如何优化left join
    mysql按日期分组(group by)查询统计的时候,没有数据补0的解决办法。
    JVM中各种变量保存位置
    CDN原理
    为什么家里的宽带的IP显示的是外地?
    2017 年 PHP 程序员未来路在何方?
    Nginx开启Gzip压缩提高页面加载速度
    git如何强制用远程分支更新本地
    真正的S2b其实是S2b2c
    判断JS数据类型的几种方法
  • 原文地址:https://www.cnblogs.com/edwardlogs/p/5148803.html
Copyright © 2011-2022 走看看