I know similar questions have already been asked.
But, I believe my issue is due to a mistake I have previously made and therefore is different: let me explain.
What fixed this for me was re-setting my origin url:
git remote set-url origin https://github.com/username/example_repo.git
And then I was able to successfully git push my project. I had to do this even though when I viewed my origins with git remote -v, that the urls were same as what I re-set it as.