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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/40837225/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 15:28:05  来源:igfitidea点击:

how to get git log without the commit message

gitbashterminalgit-bash

提问by Kasun Siyambalapitiya

I want to get the git logonly with the no of additionsand deletionswithout the author, date,commit hashand the commit messagedetails, for identifying how many lines of codes have been modified. Currently I am being able to remove all the above except the commit messageby using the following bashcommand

我想要得到的git log只与无additionsdeletionsauthordatecommit hashcommit message细节,如何识别代码的行数已被修改。目前,我可以commit message使用以下bash命令删除除上面的所有内容

git log origin/master --numstat --since="2 weeks ago"  --no-merges | egrep -v 'Author|Date|commit

The output of the above is as follows

上面的输出如下

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

为 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 个模块/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/challenge/questions/mgt/ChallengeQuestionManagementAdminServiceTestCase.java 2 0 个模块/integration/tests-integration/tests-backend/src/test/resources/testng.xml 5 0 pom.xml

更新 SAML 元数据版本

10 10 模块/p2-profile-gen/pom.xml 2 2 pom.xml

更新依赖版本

4 4 pom.xml

更改 carbon.xml 中要从项目版本中选取的版本标签的值

1 0 模块/分发/pom.xml

修复 carbon.identity.auth.version 名称

1 1 pom.xml

降级 identity.data.publisher.oauth.version 以避免测试失败

1 1 pom.xml

将依赖项更新到最新版本。

10 8 pom.xml

为 maven 版本插件使用的每个版本属性添加依赖项。

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

How can I get the output without the commit message? Thanks in advance

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

回答by Sajib Khan

You can do:

你可以做:

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

You can customize it as you needed. Here

您可以根据需要自定义它。这里

$ 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

回答by bskr

Try this

尝试这个

git log --numstat --format=