Reputation: 730
Frequently (especially with commits using --amend
) I push to heroku using git push heroku master --force
. I do this because I get an issue when trying to push without force..
issue:
o https://git.heroku.com/site.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://git.heroku.com/site.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
I see no harm in it because my remote repository and local repository are fine. Am I wrong?
Upvotes: 2
Views: 945
Reputation: 802
This warning happens because the commits are different and thus your repository cannot ensure data preservation, it is bad practice since it could lead to code data loss, as long as you know it won't, Heroku itself will not have a problem as all it does is take the code in the master branch and deploy it, regardless of previous states.
Upvotes: 3