I ran into an issue where a change to the case of a file wouldn't push to my remote repo.
I tried using git mv
to change the title but it wouldn't work. I changed the name of the file on GitHub itself and committed the change to the repo. Now my local repo won't push changes to remote.
I'm reluctant to pull an older commit into my local repo as I've made a lot of changes that I don't want to lose and have been unable to commit remotely. Is there anyway around this?
cd would-you-rather
git add .
git commit -m '9th commit'
On branch main
Your branch and 'origin/main' have diverged,
and have 3 and 1 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)
nothing to commit, working tree clean
git push
To https://github.com/xxxx/xxx.git
! [rejected] main -> main (non-fast-forward)
error: failed to push some refs to 'https://github.com/xxx/xxx.git'
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.