I got this error when trying to push to Heroku when I wasn't on my local master branch.
I resolved it with
git push heroku my_branch_name:master
and replacing my_branch_name with the name of the git branch I was on. I think this tells Heroku to receive this local branch on Heroku's master branch.