I've been having a maddening problem where one (but only one) of my heroku apps doesn't know which heroku app it is, which means I need to append
--app app-name to every single command. It seemed to happen when I moved my app to an organisation rather than having it on my personal account, but in fact the problem was that at the same time I did that, I set up the build server to deploy it - and so I removed the old heroku git remote and then never added the new one because I exactly shouldn't be pushing to heroku from my laptop as we now deploy via Jenkins.
I was looking for some config file or something that heroku would read but what it actually does is look at whether any of your git remotes are heroku and if so, assume by default that you mean that project! The git URL is on the "Settings" screen from the Heroku web interface, and you just need to add it as a remote to your local project:
git remote add heroku [paste git url from settings screen]
Hopefully this helps someone else stop having to type
--app app-name every time they need to do something with their app, it was a tiny problem but quite an annoying one!