I have a Facebook application on my local machine and another created with Heroku (the code in the Heroku application was created automatically by Heroku). I'd like to completely replace the code within the Heroku application with the code on my local machine. I've already initialized a git repository in the directory on my machine where the code is and I've set the URL with git remote add origin [email protected]:my-fb-app.git
. However, when I type in git push origin master
I get:
To [email protected]:my-fb-app.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to '[email protected]: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.
Obviously, this isn't the right approach. How should I go about doing this?
If you want to restart a git repo, nuke the . git directory and do git init add your files/directories and commit.
Browse to the directory in your repository that you want to delete. In the top-right corner, click , then click Delete directory. Review the files you will delete. At the bottom of the page, type a short, meaningful commit message that describes the change you made to the file.
you could force it
git push -f origin master
taken from https://devcenter.heroku.com/articles/git
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With