Git日志输出日志文件

编程入门 行业动态 更新时间:2024-10-27 16:24:48
本文介绍了Git日志输出日志文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在做一项大学课程的作业,我使用git作为此作业的版本控制。我一直在努力的游戏是完整的,然而,随着我想提交git日志,在我一直处理它的过程中有效地显示了我的进度。

I am doing an assignment in a university course and I am using git as version control for this assignment. The game I have been working on is complete, however, along with the hand in I would like to submit the git log, effectively showing my progress during the time I have been working on it.

我试过这个:

I have tried this:

git log --stat > log.log

但或多或少只会让我看不太清楚的东西。任何人都可以帮助我一个命令,以便我可以得到一个很好的格式呢?

But it more or less just gives me very unreadable stuff. Can anyone help me with a command so that I can get a nice formatting on this?

推荐答案

我会建议使用不同的格式比默认值。我通常的选择是对图表进行汇总,但是单独一个行汇总通常会起到诀窍的作用。

I would recommend using a different format than the default. My usual choice is summary with the graph, but one line summary alone usually does the trick.

选项1:一行摘要

git log --pretty=format:'%h : %s' --graph > log.log

结果:

Results in:

* 2d3acf9 : ignore errors from SIGCHLD on trap * 5e3ee11 : Merge branch 'master' of git://github/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:一行摘要无图

Option 2: One line summary w/o Graph

git log --pretty=format:'%h was %an, %ar, message: %s' > log.log

结果:

Results in:

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

您可以在文档中找到更多格式选项此处

You can find more formatting options in the docs here

更多推荐

Git日志输出日志文件

本文发布于:2023-11-24 05:03:12,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:日志   文件   Git

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!