3

I have 3 Feature branches and 1 Release branch. I merged code from Feature1 to Release having 2 commits. Then i am merging code from feature2 to Release having 1 commit. When i execute the git show command with 2nd merge commit its listing all the files instead of showing only feature2 merged files.

git show -m -1 6929195e --name-only --stat --pretty=format:

I want my merge commit id to list only merged files from particular branch instead of showing all the files. Please reply if you dont understand my questions.

Asma
  • 99
  • 9

2 Answers2

1

If you want to list only changed files you could use git diff <SHA>^1 <SHA>

If your case:

git diff --name-only 6929195e^1 6929195e

Inspired by this article

makozaki
  • 3,772
  • 4
  • 23
  • 47
1

If your last commit is a merge commit generated after merging feature2 into master, then you can use the following command to get the list of merged files from the feature2:

git show --first-parent <merge-commit-SHA> --name-only --pretty=format:
uneq95
  • 2,158
  • 2
  • 17
  • 28