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.
- What's the difference between git merge --no-ff and git merge --squash
- What does git rebase use to determine common ancestor?
- Is there a way to keep two branches from merging in git
- When would you use the different git merge strategies?
- tortoiseGit Reset to a previous version
- Show commits in a git merge?
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:
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.