ThinkGeek
ThinkGeek

Reputation: 5157

How can I list files changed as part of a particular commit?

How can I list changes done as part of a particular commit in the format below?

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(-)

I have tried

git show --name-only #commithash

commit eaf678f74e35affaeaa21a0df5bf086e804bcad5
Author: Lokesh Agrawal <[email protected]>
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

But it doesn't have an indication on whether files are newly added or something has changed in existing files.

Upvotes: 0

Views: 80

Answers (3)

Shantanu Bhuruk
Shantanu Bhuruk

Reputation: 23

I don't know if this is exactly what you want, but you can see list of files modified as part of commit using following command:

git log --stat

This will list down all the commits with list of files modified for each commit.

Upvotes: 0

Mureinik
Mureinik

Reputation: 312106

git show --name-only should do what you want.

EDIT:
git show --name-status will also show an indication of what changed in the file. E.g. "A" is added and "M" is modified.

Upvotes: 0

LeGEC
LeGEC

Reputation: 52111

Try git show --name-status


note : --name-only and --name-status are also valid options for git diff, git log, and a few other git commands

Upvotes: 0

Related Questions