Why is Git ignoring commits when merging? -
we have made changes 1 file in 2 branches. here file commit history on branch a:
and here commit history of same file on branch b:
now when merge branch branch b, end exact same commit history branch a. commit 56dfe991
has gone missing:
obviously, disturbing. since don't know causing this. have idea?
there no such thing "file commit history" in git. there's history, , files.
the history considered @ git repository granularity, i.e. each commit has set of parents. see when run git log
, or more visual output git log --graph --oneline --decorate
.
now, can ask git filter history on per-file basis, e.g. git log -- file
. hides commits not touch file, but history simplifications hide commits not contribute file history. documented in details in "history simplification" section of git log's documentation.
essentially, when reaching merge commit, if 1 of parent of merge commit not introduce change file, parent ignored.
as result, example, git log
, git log .
@ root of project may show different histories.
Comments
Post a Comment