如何完全替换git存储库中的代码

Joh*_*nny 14 git heroku

我在本地计算机上有一个Facebook应用程序,另一个用Heroku创建(Heroku应用程序中的代码由Heroku自动创建).我想用我本地机器上的代码完全替换Heroku应用程序中的代码.我已经在我的机器上的代码所在的目录中初始化了一个git存储库,并且我已经设置了URL git remote add origin git@heroku.com:my-fb-app.git.但是,当我输入时,git push origin master我得到:

To git@heroku.com:my-fb-app.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@heroku.com:blooming-cove-5867.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Run Code Online (Sandbox Code Playgroud)

显然,这不是正确的方法.我应该怎么做呢?