Can I compare branches by content rather than commits using Git? I almost see that I can't. Why?
Explanation: I have branch A which I merged with B , but then later in history I reverted that merge in A.(That revert wasn't actually a revert, but merge from pull , because I tried to push before I pull and branch got diverged which led me into merge that reverted my previous merge). And now B and A show no difference because they are compared by commits rather than content.
C0---C1---C2---C3---C4---C5 -> branch B
/
C1--C2 -> branch A
Steps I am doing:
- C3 - is the merge commit from branch A to branch B
- C2 - is where my head is locally (behind)
- Right now I want to push my locally made commit(C4) to remote branch B which leaves my local branch B diverged and I need to pull before push. Which produces merge between C3 and C4.
- However I am not careful and my pull's merge reverts my previous merge from branch A to branch B(C3) and all changes from C3 are gone.
What I want to do right now is to merge branch A to branch B again like I did(C3) , but when I compare them it shows no difference , because C1 and C2 commits are actually in branch B and there is no commit difference , but the content is different because I reverted them by accident in my pull's merge(C5). And that led me to the question why and is there a way of git comparing branches by content rather than commit hash?