1. git init
在本地新建一个repo,进入一个目录,执行git init,会初始化一个repo,并在当地文件创建一个.git文件夹
2.git clone
获取一个url对应的远程git repo ,创建一个local copy
一般格式git clone url
3.git status
查询repo状态
git status -s :-s 表示short,-s的输出标记会有两列,第一列是对staging区域而言,第二列对working目录而言
4.git log
show commit history of a branch.
git log --oneline --number:每条log只显示一行,显示的number行
git log --oneline --graph:可以图形化地表示出分支合并历史
git log branchName :显示特定分支的log
git log --oneline branch1^branch2 可以查看在分支1,却不在分支2中的提交.^表示排除这个分支(Window下可能要给^branch2加上引号).
git log --decorate会显示tag信息
git log --author=[author name] 可以指定作者的提交历史
git log --sinece