Reputation: 486
I am kind of stuck here while trying to update my first node.js app in heroku.
The initial version of the app is deployed successfully but now when I try to deploy the modified app it's giving me some problem. Here is the command and the output
> git push heroku master
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to '[email protected]:....git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the 'Note
about fast-forwards' section of 'git push --help' for details.
The git status command display's the following :
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
Upvotes: 2
Views: 2449
Reputation: 5438
The obvious thing you should do is get your local repositiory in sync with the remote one. As the error message text shows, this is probably as simple as running a pull:
git pull
If that isn't enough to clear up your problem, you probably need to rebase your local work on the remote branch. If you only have on remote (your heroku repository) you can probably do this as simply as:
git rebase
With that done, you should then be able to push without introducing a conflict in the remote repository.
Note that you typically do not want to use the rebase function if any of your local commits have been pushed any remote repositories. That will only introduce a puzzling set of circular changesets.
Upvotes: 0
Reputation: 17631
On heroku it makes sense to do:
git push -f heroku master
since you are not using it as a revision system but as a deployer.
Upvotes: 5