It always helps to get a good view of the history in question here.

First to a git fetch heroku to get the latest on what's up there.

Then do either do command line style: 

git log --graph --oneline --decorate --all

Or fire up gitk for all (also remote) branches:

gitk --all

Does it become a little clearer?

My guess is that you'v done some commit on, then maybe you have 
pushed that to heroku (or from somewhere else). Now later on, you haven't 
gotten the latest state that was pushed to heroku into your own local 
repository, hence it is out of sync.

The solution is usually either to sync history either by 

1) rebasing the changes that are on heroku into your own local 
repository/branch (using git rebase heroku/master) or 
2) merging (git merge heroku/master)

.. and then trying to push again. 

On Thursday, January 24, 2013 3:41:32 PM UTC+1, Bryce Martin wrote:
> I'm new to git, so be gentle.  I'm missing something with deploying a repo 
> to a remote.  Here is the scenario...
> I'm hosting a private repo on Bitbucket.  I pulled the repo down to a 
> workspace, essentially its just a local copy (but local to their vm 
> running my dev environment)... anyway.... I'm going to host it on heroku.  
> So I want to push the local master branch I'm working on up to heroku.  I 
> have already done this once, but that is when there was nothing in the 
> heroku repo.  Now, I made some changes to my local copy and have all of the 
> changes committed.  My working copy is clean.  I want to push it up to 
> heroku... what I really want is for it to accept the push and automatically 
> merge the changes onto the remote.  I tried to do a git push heroku master, 
> but I get an error saying that they are out of sync or something like that.
> My thought was to do a fetch/merge and merge my local into the remote I 
> fetched... I would then have to push that back?  I guess I'm a little 
> confused on how to make this happen...  Do I need to supply you with any 
> more details?


Reply via email to