本地git简单使用

项目未勾选git情况

 

打开文件夹   cd /Users/jiabin/Desktop/demo09

显示其中文件 ls -l  total 0
          drwxr-xr-x  10 jiabin  staff  340 12 11 17:50 demo09
          drwxr-xr-x   5 jiabin  staff  170 12 11 17:50 demo09.xcodeproj
          drwxr-xr-x   4 jiabin  staff  136 12 11 17:50 demo09Tests

          

初始化git仓库    git init   Initialized empty Git repository in /Users/jiabin/Desktop/demo09/.git/
          jiabindeMacBook-Air:demo09 jiabin$ git reflog
          fatal: bad default revision 'HEAD'

     git add .

     git commit -m "注释"       后面就有一大堆creat内容,就创建好了

查看git    git reflog       afc2095 HEAD@{0}: commit (initial): 注释

 

回到afc2095版本        git reset --hard afc2095   HEAD is now at afc2095 注释

config的使用        git config alias.rst 'reset --hard'

                  git rst 758adae

                  HEAD is now at 758adae 添加了新内容

 

      

 

posted @ 2015-12-11 10:18  wo也不懂  阅读(162)  评论(0编辑  收藏  举报