We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
早期提交日志
参数说明:
--pretty=format
--reverse
-n
n
$ git log --pretty=format:"%h [%an - %ar] : %s" --reverse # Vue 5f19affa [Evan You - 5 years ago] : init 706c67d1 [Evan You - 5 years ago] : restructure # checkout 到 commmit id $ git checkout 706c67d1 # 再回来 $ git checkout master # --pretty=format 显示控制参数 选项 说明 %H 提交对象(commit)的完整哈希字串 %h 提交对象的简短哈希字串 %T 树对象(tree)的完整哈希字串 %t 树对象的简短哈希字串 %P 父对象(parent)的完整哈希字串 %p 父对象的简短哈希字串 %an 作者(author)的名字 %ae 作者的电子邮件地址 %ad 作者修订日期(可以用 -date= 选项定制格式) %ar 作者修订日期,按多久以前的方式显示 %cn 提交者(committer)的名字 %ce 提交者的电子邮件地址 %cd 提交日期 %cr 提交日期,按多久以前的方式显示
制作常用命令别名
$ git config --global alias.logs "log --pretty=format:'%h [%an - %ar] : %s'" # 使用 $ git logs --reverse
The text was updated successfully, but these errors were encountered:
No branches or pull requests
源码学习
1. 对项目足够了解
2. 查看项目早期代码
早期提交日志
参数说明:
--pretty=format
控制显示的记录格式--reverse
倒序排列-n
查看前n
条纪录制作常用命令别名
参考资料
The text was updated successfully, but these errors were encountered: