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 (推送到远程服务器)
    ------------------------------------------
  • 相关阅读:
    Hackerrank alien-flowers(数学公式)
    Hackerrank manasa-and-combinatorics(数学推导)
    Codeforces 314B(倍增)
    Codeforces Round #403(div 2)
    Mutual Training for Wannafly Union #6
    几道splay
    高数(A)下 第十章
    Bestcoder #92
    codevs1700 施工方案第二季
    poj2631
  • 原文地址:https://www.cnblogs.com/edwardlogs/p/5148803.html
Copyright © 2011-2022 走看看