Changes I never merged are in master... how?

I branched off master and made some changes, today someone mentioned I had some bad commits and after I checked it turns out some stuff from my branch was in master(not all). I did a bisect and I can see what commit it was but that commit is part of my feature branch, not master.. Somehow it looks like other merges were done with my branch(which is local only)..


The only thing I can think of is Sourcetree for some reason thought I was in master for some of my commits...


How can I further research this?



1 answer

There are basically two options (might be a combination of these):

  1. You committed directly to master
  2. You merged your feature branch to master at a certain point.

If you look at the commit graph (Do you see lines diverging/converging?) in the main SourceTree window, you should be able to make the distinction.

This is the point where the issue started: Where the purple line branches off into the green is where I created my branch. Now notice I have one commit int he green branch, then I see a merge back into purple. that merge is from another person that wouldn't even have access to my local branch, but it shows it being merged and my commits continue further up.. This doesn't make sense to me..

[Assuming purple=master and green=feature, correct me if wrong.] The third commit above the selected one is definitely a merge of the feature branch into the master and yes, they feature branch continues after this. I think you are wrong about either of these: - The merge commit having been made by somebody else. - The somebody else not having access to your branch, your branch being local only. The more probable one is the second case, you pushed your branch to the server after committing the one above the selected commit and then someone else merged it to master. (A bit hard to tell without seeing the branch labels and the rest of the picture.)

Yea, I know it's what it is showing... But the green branch only ever has commits from me and it's separate from master. Only this merge is coming into master, and it's from someone that doesn't have any other commits in it. If I would have committed to master, I would see the commit in master and then me continuing in the green branch, but that's not the case. The green branch continues with only my feature commits.. I didn't merge into master, until a lot further up.. the only merge into master is int he picture, from a user with nothing else in that branch. I know it doesn't sound right, which is why I'm so confused.. What else can I do to look into it?

OK. The thing you were wrong about is "The somebody else not having access to your branch, your branch being local only." Everybody has a full clone of the repo with all the branches. Once you pushed your changes, somebody got "your" branch from the server and (probably accidentally) merged it to master. Perhaps you could ask the person who made the merge commit why they did that.

I never pushed this branch, and I asked the person and he said he hasn't pulled any branches and has only been pushing to master... I'll keep an eye out for any similar incidents. I'm not saying I'm not to blame(I probably am)..

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 23, 2018 in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

962 views 4 2
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you