I have a local and remote repository of a single line file. On my local folder, I made a few changes and am trying to push them to github.
I have made no changes to the remote repo, but somehow when I try to push from the command line it says I'm behind the remote counterpart, and tells me to try a pull. But that also fails due to "unrelated histories".
andy@andy-VirtualBox:~/Code/EditMe$ git push origin main
To https://github.com/MorningPants/EditMe
! [rejected] main -> main (non-fast-forward)
error: failed to push some refs to 'https://github.com/MorningPants/EditMe'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
andy@andy-VirtualBox:~/Code/EditMe$ git pull origin main
From https://github.com/MorningPants/EditMe
* branch main -> FETCH_HEAD
fatal: refusing to merge unrelated histories
after browsing similar questions, this info also seemed pertinent:
andy@andy-VirtualBox:~/Code/EditMe$ git remote -v
EditMe www.github.com/MorningPants/EditMe (fetch)
EditMe www.github.com/MorningPants/EditMe (push)
origin https://github.com/MorningPants/EditMe (fetch)
origin https://github.com/MorningPants/EditMe (push)