How to specify path when doing git show on a merge commit

I’ve got a merge commit, and I can show the entirety of it using git show -m. However, if I want to only show the change for a subfolder or a path, how do I do it? I tried doing git show -m -- app/ but it didn’t show anything, even though git show --stat indicates that there were merges going on in that part of the repository.

  • Merging vcproj files - SCM's hell
  • Merge two repositories (original project and changed project WITHOUT HISTORY)
  • git branch merging details
  • Fixing 'backwards' git merge that was pushed
  • Git merge squash repeatedly
  • What is the difference between merging master into branch and merging branch into master?
  • Proper git etiquette for users working in mostly-isolated branches?
  • Merging 2 branches together in GIT
  • One Solution collect form web for “How to specify path when doing git show on a merge commit”

    You can use --relative for that:

    git show -m --relative=app/
    

    But it will show paths relative to the directory provided in the path:

    --relative[=<path>]

    When run from a subdirectory of the project, it can be told to exclude changes outside the directory and show pathnames relative to it with this option. When you are not in a subdirectory (e.g. in a bare repository), you can name which subdirectory to make the output relative to by giving a <path> as an argument.

    Git Baby is a git and github fan, let's start git clone.