git从github下载代码

Github作为远程仓库的使用详解  http://blog.csdn.net/djl4104804/article/details/50778717

centos local:
    
    通过git remote来设置远程仓库地址:
        git remote add origin https://github.com/coder-pig/SimpleTea.git
        
    假如你想修改远程仓库地址,比如你把仓库托管换成了Git@OSC,你需要修改远程地址,可以键入:
        git remote set-url origin xxxx
        你也可以先删除origin然后再添加:
            git remote rm origin
            git remote add origin https://github.com/coder-pig/SimpleTea.git
            
    同步远程服务器更新(fetch VS pull)
        git fetch origin master
        git merge origin/master
        fetch和pull,尽管都可以获取远程服务器更新,但是两者却又是不一样的。
        首先说下fetch吧,仅仅只是从远处服务器获取到最新版本到本地,假如你不去合并(merge)
        的话,本地工作空间是不会发生变化的!
        
        用pull是一步到位的,或者说:pull = fetch + merge
        
    更新到某一版本:
        git checkout 28a24c0bc75fe305fbe9ee1b956f4658db2071f5;

  

  git覆盖本地文件:

    git checkout .  #本地所有修改的没有的提交的,都返回到原来的状态

=================

git使用说明 http://www.cnblogs.com/welfear/archive/2010/05/24/1742614.html

原文地址:https://www.cnblogs.com/mylinux/p/5601258.html