Deploy a pre existing django git repo to heroku

I have a DJango git repository.Me and some other developers are working on it and it has multiple branchs also. Now i want to deploy it to Heroku or want to use the heroku as a staging server means before pushing to git i want to push the code changes to heroku and if verified will push changes to git. For this i have created a heroku app using this git repo by running

heroku create 

command for heruku. But the problem is when i make a commit it is directly committed to the git not to the heroku.

  • How to exclude south migrations from public repositories?
  • Should I add Django admin static files to my git repo?
  • git push heroku master: Heroku push rejected, no Cedar-supported app detected
  • Git - How to deploy code from my central Git repo to my production server?
  • “git push”: slug compilation hangs
  • How to develop multiple pip packages in a git project?
  • I have tried to delete the heroku app from the local git repo by running

     `heroku apps:destroy –a guarded-tundra-1589 --confirm` 
    

    but when i again tried to push the heroku master code is pushed to it. means it doesn’t get deleted.

    Tell me the right way to deploy the project which already has a git repo to heroku.

  • bad configuration option in git
  • What's the best way to edit GitHub's Readme.md?
  • How does Perforce ignore file syntax differ from gitignore syntax?
  • how to run a github pulled project with laravel?
  • git: editing a file cause ^M to appear when using git diff
  • How to install portia, a python application from Github (Mac)
  • 2 Solutions collect form web for “Deploy a pre existing django git repo to heroku”

    There are standart Heroku commands to do this:

    $ heroku auth:login
    ... output omitted ...
    $ heroku create --stack cedar
    ... output omitted ...
    $ git commit -a -m 'Mods to run on Heroku.'
    $ git push heroku master
    

    UPDATE:

    Also if you are planning to use Heroku in future it could be useful frt you to check their official Documentation – Getting Started with Django on Heroku

    This will delete your repo, but this what worked for me when I got that error.

    rm -rf .git
    git init 
    git add .
    git commit -m "First commit"
    heroku create --stack cedar
    git push heroku master
    
    Git Baby is a git and github fan, let's start git clone.