我正在做一个大学课程的作业,我正在使用git作为这个作业的版本控制。我一直在做的游戏已经完成了,但是,随着我想提交git日志,我想提交git日志,有效地显示了我在这段时间内的进度。
我已经尝试过了:
git log --stat > log.log但它或多或少只是给了我一些非常难以阅读的东西。有没有人能帮我写一个命令,这样我就可以得到一个很好的格式了?
发布于 2012-04-08 22:15:40
我建议使用与默认格式不同的格式。我通常的选择是用图表进行汇总,但通常只有一行汇总就行了。
选项1:带图形的单行摘要
git log --pretty=format:'%h : %s' --graph > log.log结果为:
* 2d3acf9 : ignore errors from SIGCHLD on trap
* 5e3ee11 : Merge branch 'master' of git://github.com/dustin/grit
|\
| * 420eac9 : Added a method for getting the current branch.
* | 30e367c : timeout code and tests
* | 5a09431 : add timeout protection to grit
* | e1193f8 : support for heads with slashes in them
|/
* d6016bc : require time for xmlschema选项2:单行摘要,不带图形
git log --pretty=format:'%h was %an, %ar, message: %s' > log.log结果为:
a6b444f was Scott Chacon, 5 days ago, message: dammit, this is the second time this has re
49d77f7 was Scott Chacon, 8 days ago, message: modified index to create refs/heads if it i
9764edd was Hans Engel, 11 days ago, message: Add diff-lcs dependency
e1ba1e3 was Hans Engel, 11 days ago, message: Add dependency for Open4
0f87b4d was Scott Chacon, 12 days ago, message: merged recent changes您可以在docs here中找到更多格式选项
发布于 2015-03-14 11:43:55
试试这条线
git log > log.txt
发布于 2015-03-14 12:11:50
git log --oneline --decorate > log.txthttps://stackoverflow.com/questions/10063407
复制相似问题