时到今日,各种工具的出现,例如idea在git上有很好的支持。但是最为基础的git 命令还是需要知道的,不然因为工具的功能,限制了我们的想象力。以下为我微微总结的git log的其他用法。
一、git日志格式化输出
git log --oneline
--oneline标记将每个commit压缩成一行. 默认情况下显示一个commit ID和commit描述的第一行
输出如下:
D:\giteeWorkSpace\springcloud>git log --oneline
9032cba JWT
4477d7d securityJwt配置reids
2fb1914 优化代码
43030ff 1
efd6dc7 优化全局resttemplateconfig , 和resttemplatetointerface
0504e45 优化全局resttemplateconfig , 和resttemplatetointerface
99c3ba4 完善,并检验HttpClient
f5c0747 完善,并检验CloseableHttpClient
281dfa5 完善,并检验httpUtil
bfd197d 优化
git log --oneline --decorate
许多时候知道commit是和哪一个分支或tag关联的是非常有用的. --decorate标记会让git log显示每个commit的引用(如:分支、tag等).
输出如下:
0e25143 (HEAD, master) Merge branch 'feature'
ad8621a (feature) Fi