如何在没有提交消息的情况下获取 git 日志

how to get git log without the commit message

我只想得到 git log 没有 additionsdeletions 而没有 author, date,commit hashcommit message 详细信息,用于识别修改了多少行代码。 目前,我可以使用以下 bash 命令

删除除 commit message 之外的所有内容
git log origin/master --numstat --since="2 weeks ago"  --no-merges | egrep -v 'Author|Date|commit

上面的输出结果如下

Adding test case for IDENTITY-3591

4 0 modules/integration/tests-common/admin-clients/pom.xml 129 0 modules/integration/tests-common/admin-clients/src/main/java/org/wso2/identity/integration/common/clients/challenge/questions/mgt/ChallengeQuestionMgtAdminClient.java 223 0 modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/challenge/questions/mgt/ChallengeQuestionManagementAdminServiceTestCase.java 2 0 modules/integration/tests-integration/tests-backend/src/test/resources/testng.xml 5 0 pom.xml

Updating SAML metadata version

10 10 modules/p2-profile-gen/pom.xml 2 2 pom.xml

Updating dependency versions

4 4 pom.xml

Changing value of the version tag in carbon.xml to be picked from the project version

1 0 modules/distribution/pom.xml

Fixing carbon.identity.auth.version name

1 1 pom.xml

Downgrading identity.data.publisher.oauth.version to avoid test failures

1 1 pom.xml

Update dependencies to latest versions.

10 8 pom.xml

Adding dependencies for each version property to be used by maven version plugin.

29 28 modules/p2-profile-gen/pom.xml 175 4 pom.xml

如何在没有 commit message 的情况下获得输出?提前致谢

你可以这样做:

$ git log --stat --format="%H"

您可以根据需要对其进行自定义。这里

$ git log --pretty=format:"%h $ad- %s [%an]"

Here:
- %ad = author date
- %an = author name
- %h = commit hash (short)
- %H = commit hash (full)
- %s = subject
- %d = ref names
 

Git's pretty docs 列出所有占位符。

试试这个

git log --numstat --format=