如何以以下格式列出作为特定提交的一部分所做的更改?
repo: agrawalo/interviewing
branch: master
commit: c917020b
Batman! This commit has no parent
author: Lokesh Agrawal at 2018-05-16T20:58:17+05:30
Summary of changes:
pom.xml | 10 +++
+ src/main/java/DBTest.class | 10 +++--
+ src/main/java/DBTest.java | 8 +++-
src/main/java/com/interviewing/Application.java | 8 ++++
+ src/main/java/com/interviewing/constant/QuestionArea.java | 88 +++-
+ src/main/java/com/interviewing/controller/QuestionController.java | 78 +++--
src/main/java/com/interviewing/entity/Question.java | 17 ++++++
src/main/java/com/interviewing/entity/Skill.java | 23 ++++++++
src/main/java/com/interviewing/repository/QuestionRepository.java | 37 ++++--
+ src/main/java/com/interviewing/repository/SkillRepository.java | 9 ++++++-
+ src/main/java/com/interviewing/service/QuestionService.java | 11 ++++++-
+ src/main/java/com/interviewing/service/QuestionServiceImpl.java | 20 ++++--
src/main/resources/application.properties 13 ++++++
+ src/test/java/com/interviewing/repository/QuestionRepositoryTest.java | 23 +++-----
n files changed, x insertions(+), y deletions(-)
我试过了
git show --name-only #commithash
commit eaf678f74e35affaeaa21a0df5bf086e804bcad5
Author: Lokesh Agrawal <agrawalo@deshaw.com>
Date: Fri May 11 12:23:27 2018 +0530
Batman! This commit has no parent
.gitignore
mvnw
mvnw.cmd
pom.xml
src/main/java/com/interviewing/Application.java
src/main/java/com/interviewing/entity/InterviewMatrix.java
src/main/java/com/interviewing/entity/Question.java
src/main/java/com/interviewing/repository/InterviewMatrixRepository.java
src/main/java/com/interviewing/repository/QuestionRepository.java
src/main/resources/application.properties
src/test/java/com/interviewing/StructuredInterviewingApplicationTests.java
但它没有指示文件是新添加的还是现有文件中的某些内容已更改。
尝试git show --name-status
注意:--name-only
和--name-status
也是git diff
、git log
和其他一些 git 命令的有效选项
git show --name-only
应该做你想做的事。
编辑:
git show --name-status
还将显示文件中更改内容的指示。例如,添加"A"并修改"M"。
我不知道这是否正是您想要的,但是您可以使用以下命令查看作为提交的一部分修改的文件列表:
git log --stat
这将列出所有提交以及为每个提交修改的文件列表。