After creating my app I tried to push it and deployed it to Heroku but an annoying error occured (screenshot attached). I have seen that a lot of developers had the same problem on Heroku deployment therefore I decided to create this post.

Here is the steps I used to solve the problem:

Firstly, You need to cd in to your project directory

Do the following: cd path/to/root/of/your/project and try the command again.

Reinitializing your .git files:

rm -rf .git
git init
git add .
git commit -am "Reinitialize"
heroku create --stack cedar
git push heroku master