Myself and a coworker are working on the same branch (not all the time, but at the moment). He and I both made a commit around the same time and he pushed his changes.
I did my push via Github Desktop and I was surprised to see that there were two commits assigned to myself: My original commit and a "Merge branch 'xyz' of https://github.com/company/repository into xyz", which I didn't expect. It looks like I merged his changes into the branch.
My expectation was that, since I was not doing a force push, I can't set the branch to include my changes without my coworker's changes. From what I can see from the Github Desktop logs, it looks like a pull (and therefore merge) was done prior to the push. However, looking at the history, it appears to me like the branch was set to include my changes first, without my coworkers changes, and then I merged those changes in, exactly what I thought would be impossible without doing a force push.
My preferred 'state' for the history would be to show only my changes merged into the branch, not that I made my coworker's changes. Is the only way to accomplish this to create a new named branch with my changes, commit to that and push, switch back to the original branch, then merge from the newly named branch?
For some reason, I thought that this would essentially happen without going through all these extraneous steps. Was I wrong? Is there a better way to accomplish this?
Thanks!