我在GIt中有一个开发分支,开发人员已在该分支中进行了更改并在消息中添加了Jira票证。同样,许多提交未在消息中定义Jira票证
现在,我想创建一个外壳程序来获取所有提交ID的列表,包括作者,提交,提交,在消息部分未添加Jira编号的日期。该消息只是定义了字符
答案 0 :(得分:2)
有git log命令:
git log --graph --abbrev-commit --decorate --format=format:'%h %ai %s - %an' --all
您可以通过管道传输到的
grep -v <JiraPattern>
以禁止具有JiraPattern的提交。
选中git format doc以完全满足您的需求。
欢呼
答案 1 :(得分:1)
git log -E --grep=<jirapattern> --invert-grep --pretty="%H %an %cn %cd %s" --all
jirapattern
is a regex for the jira ticket. --grep=<jirapattern> --invert-grep
limits the output to commits whose messages do not contain the jira ticket. You might also want to use --no-merges
to exclude the merge commits, and --data=format:"<formatstring>"
to format the committer date.