我有一个 git 存储库,我可以使用 .gitignore 查看特定分支中的所有提交git log branch-name。但我想打印 HTML 页面上特定分支的提交消息、作者和所有提交的日期。有什么解决办法吗?
我该如何使用jgit它?
我不知道jgit,但在正常的 git 中你可以使用pretty以下选项来做到这一点
git log --pretty="%ci %an %s" branch-name
Run Code Online (Sandbox Code Playgroud)
其中%ci是日期 (ISO),%an是提交者,%s是主题。
编辑
您可以在日志文档的漂亮格式部分找到更多信息:https://www.kernel.org/pub/software/scm/git/docs/git-log.html#_pretty_formats