I have a local repo where I have put a file 'notes' where i keep some text about my own observations and concerns. When I commit and push to the remote repo I must remove the file. Before I initially made the commit I ran git rm --cached notes
but this apparently did not work because after I pushed the notes file appeared on github.
So what I did locally was run rm
again (somehow it works this time) and do a
git commit --amend
and then git show --stat --oneline HEAD
and I notice notes has been removed.
But now in order to push I must merge the remote changes into my local repo because
Updates were rejected because the tip of your current branch is behind its remote counterpart.
So I run a pull but this fails as well with:
CONFLICT (modify/delete): notes deleted in HEAD and modified in 5bfdf....
What do I need to do to simply delete the notes files from this commit both locally and remotely?