Git branched on its own, WTH happened?

Eric_the_Cerise
Sun, 02 Jul 2023 07:52:48 +0000

I cannot push nor pull to/from my local repo to/from my remote. I get the message "Your branch and 'origin/main' have diverged", etc.

I will be able to fix it, I'm already in the process of refreshing my memory on how to rebase this cleanly.

But ... I am the only person working on this. I have only one local and one central/remote repository. And I never made a branch.

It's just me, working on one computer, right here ... make a few commits locally, then push 'em ... make a few commits locally, then push 'em. That is my entire workflow.

How in the hell did I end up with "my branch" (???) and the origin/main branch being in conflict with each other?

Any Git gurus care to take a stab at this?

Thanks in advance.

Edit, more info:

I am guessing here, but for awhile I was working in a VM on my local machine ... but Android SDK is too much of a resource hog, so I committed and pushed everything on the VM, shut it down, and then pulled latest down to my actual machine ... or at least, that's how I remember it.

My working theory is that, somehow, I screwed up that "switching between machines" process, although, so far, no clue as to how/why I did.

Theory #2 is that Android SDK did something sneaky/stupid behind the scenes -- my last several commits have been done through the Android Studio IDE, not directly in the terminal.

Last Edit:

D'oh!

Found it. I made a couple of "quick changes" to the project's README.md file directly in the remote forge, and that's what screwed me up.

Comments URL: https://tildes.net/~comp/17dt/git_branched_on_its_own_wth_happened

Votes: 10

Comments: 11