1、初始化配置
在某个文件夹右键 git bash here  初始化: 
2、git基本操作
touch :创建文件 
git status :查看修改的状态(暂存区、工作区) 
git add 文件名|通配符 :将所有修改加入暂存区
git commit -m "注释内容" :提交暂存区内容到本地仓库的当前分支 
git log :查看提交日志 
git log [option] :
options:
--all:显示所有分支
--pretty=online:将提交信息显示为一行
--abbrev-commit:使得输出的commitId更简短
--graph:以图的形式显示
git reset --hard commitID :版本回退 git-log :查看commitID git reflog :查看已经删除的提交记录
3、git分支
git branch :查看分支  git branch 分支名 :创建新分支  git checkout 分支名 :切换分支名 git checkout -b 分支名 :切换分支名(没有则创建)  HEAD指向谁是谁就是主分支 git merge 分支名称 :一个分支上的提交可以合并到另一个分支 git branch -d b1 :删除分支
|