dt.
dt.

Reputation: 704

Git removed/removing an already merged file without a delete commit

I'm trying to figure out how this situation is occurring, a bit of a mystery, related to a file that has disappeared without a corresponding delete commit.

The file was created in a branch and then merged into master, and now somehow is not present in master. When I run:

git checkout master
git merge my_branch

It shows 'up to date'.

When I run, from master:

git log --all --/path/to/file

it shows only the initial commit where the file is first created, but it is not actually present in the directory. However, if I checkout the branch itself, the file is there.

So, the file has disappeared from master somehow, sometime, but there is seemingly no associated delete commit.

It seems like this should not be possible. Any ideas or suggestions on how to investigate this would be very much appreciated.

Upvotes: 0

Views: 65

Answers (1)

torek
torek

Reputation: 489083

There's still a lot of interesting side items in the comments, but I suspect your:

git log --all -- path/to/file

is getting trimmed down by History Simplification.

You can avoid this in one of two ways: either add --full-history, which simply disables history simplification entirely, or add -m, which splits merges (so that there is nothing to simplify). I have not tested the -m method.

Upvotes: 1

Related Questions