Here is a test repo demonstrating the problem: https://bitbucket.org/vektor330/bugtest
The sequence of events is this:
Conflict
and source
to develop
.Conflict
to master
.develop
into master
, resolving conflict on Conflict
using "mine" strategy, and removing source
from the repository. This is now an empty commit, but can be commited and pushed back to remote.The result is: source
has disappeared completely from the repository. It appeared in 7dfa23e, there is a log of it appearing in the repo, and it quietly disappeared in 5080a24, without a single trace.
I would expect the commit 5080a24 to show "source
removed", what is wrong with Git or my expectation?
If you remove a file in one branch, the merge will remove it in the target branch too.
why this wouldn't show as the "content of the merge commit".
You can visualize the content of the merge commit by selecting the merge commit and each of the two parents in turn.
When you select (in SourceTree) the one from the develop branch (in addition of the merge commit), you clearly see that files_to_lose/source
have been removed:
Why does the commit itself not show the missing file?
Because in the case of a merge commit, there are two parents to compare against. SourceTree doesn't offer the diff against those two parents.
GitHub for Mac or Windows does, when you select only the merge commit:
In short, this isn't about Git, just about the Git GUI that you are using.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With