配置Git提交信息
git config --global user.name kimismegit config --global user.email lily@example.com
创建本地仓库
git initgit init myRep
添加文件到暂存区
git add test.txtgit add .
查看文件状态
$ git statusOn branch masterNo commits yetChanges to be committed: (use "git rm --cached..." to unstage) new file: test.txt
将暂存区文件提交到本地仓库
git commit -m "first commit"
查看当前文件与版本库文件区别
修改test.txt
$ git diffdiff --git a/test.txt b/test.txtindex e69de29..d800886 100644--- a/test.txt+++ b/test.txt@@ -0,0 +1 @@+123\ No newline at end of file
查看提交历史
$ git logcommit 97d2b0e53d07909d5df2cac308d48e36e518d64a (HEAD -> master)Author: KimismeDate: Sun Jan 7 22:08:13 2018 +0800 first commit
通过加参数过滤
git log --pretty=oneline