码迷,mamicode.com
首页 > 其他好文 > 详细

git 用法详解小记

时间:2015-10-21 00:00:06      阅读:265      评论:0      收藏:0      [点我收藏+]

标签:

1.安装 sudo apt-get install git    git config --global user.name "yourname"       git config --global user.email "137505******@163.com"
2.初始化:
①创建一个目录:mkdir reangittoday
②git init   

③->git add filename
  -> git commit -m "添加说明文字"
  ->git commit -a -m "添加说明文字"(把 Changes bu not updated 属性文件也提交仓库更新)

④git status 查看当前暂存区文件更改情况

⑤->git log 查看日志
  ->git reset --HARD head^ 回滚

  ->git reset --HARD hashnum

  ->git reflog  查看历史输入命令

⑥->git checkout --filename (回滚文件)

   ->git HEAD filename   ->git checkout --filename     (infor :: 此时适用于已经使用 ->git add filename)

 ->git reset hard head^      (infor :: 此时适用于系统版本号已经更新)

⑦->rm filename or ->git rm filename  ->git commit -m  "delete filename  " 

 

git 用法详解小记

标签:

原文地址:http://www.cnblogs.com/coderecord/p/4896325.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!