1. git目录下的文件状态变化图
    1. 文件状态变化
  2. 当前工作状态
    1. 提交后的分支状态,HEAD是我们当前的工作节点
  3. 分支
    1. 本地分支
      1. 切换分支--git checkout xxx分支名
        1. 1.改变HEAD的指向
        2. 2.改变工作目录了下所有的文件内容,保持与HEAD指向的节点的所有内容一致
        3. 3.继续提交后,可能会导致不同的分支
          1. 切换回主分支后继续开发
      2. 生成和切换分支,git checkout -b xxx分支名
      3. 生成分支--git branch xxx分支名
      4. 删除本地分支--git branch -d xxxname
    2. 远程分支
      1. 1.查看所有远程分支信息 git remote -v
      2. 2.添加远程分支 git remote add (shortName) (Url)
      3. 3.远程抓取信息 git fetch (shortName)
      4. 4.查看远程仓库信息 git remote show (shortName)
        1. 包含较多复杂信息
      5. 5.本地远程仓库删除 git remote rm (shortName)
      6. 6.本地远程仓库重命名 git remote rename (shortName)
    3. 打标签
    4. 在本地分支上工作的例子
      1. 1.git branch testing
        1. 子主题 1
      2. 2.git checkout testing
        1. 子主题 1
      3. 3.some edit and commit on testing
        1. 子主题 1
      4. 4.git checkout master
        1. 子主题 1
      5. 5.some edit and commit on master
        1. 子主题 1
      6. 6.突发事件——需要hotfix
        1. 子主题 1
      7. 7.hotfix合并到master
        1. 子主题 1
      8. 8.回到testing继续工作
        1. 子主题 1
      9. 9.合并master、testing
        1. 子主题 1
        2. 子主题 2
    5. 与远程分支一起工作
      1. 1.本地状态
        1. 子主题 1
      2. 2.some editor and commit
        1. 子主题 1
      3. 3.提交之前先fetch
        1. 子主题 1
  4. "小技巧大省事”
    1. 自动补全
      1. git-completion.bash
    2. 放弃本地所有工作,强制与服务器同步
      1. git reset --hard origin/master
  5. 理想工作流程
    1. 子主题 1