When I have two branches that have been merged, and in each one the same change was made independently, the git log of that file shows only one of these instances, while the git
The answer is buried in the git rev-list documentation (this same text is included in the git log documentation but since virtually everything uses rev-list
, I think it's the right place to remember as your general lookup location):
History Simplification
Sometimes you are only interested in parts of the history, for example the commits modifying a particular <path>. But there are two parts of History Simplification, one part is selecting the commits and the other is how to do it, as there are various strategies to simplify the history.The following options select the commits to be shown:
- <paths>
- Commits modifying the given <paths> are selected.
[snip]
The following options affect the way the simplification is performed:
- Default mode
- Simplifies the history to the simplest history explaining the final state of the tree. Simplest because it prunes some side branches if the end result is the same (i.e. merging branches with the same content)
--full-history
- Same as the default mode, but does not prune some history
You're using the default mode when you (presumably) want --full-history
mode. Note that history simplification gets activated when you use the <paths> notation to introduce history selection: that's why you don't need --full-history
without it.