On Sat, May 17, 2014 at 10:04:42AM -0400, Richard Heck wrote:
> 
> Your original problem was due to the fact that you had changes on
> the 2.0.x branch that had not yet been pushed. The command "git
> push", with no options, pushes everything that needs pushing unless
> you have set the config option Scott mentioned before. So git is
> trying to push to 2.0.x, but that branch is not up to date, so it is
> refusing to do so.

I am sure I had no changes in 2.0.x. I remember I had to fight hard
against "git gui" before convincing it that I would have liked to
drop 2.0.x and activate 2.1.x. Eventually I won, but it was still
not tamed, apparently.

> Here's an example:
> 
> ../lyx/lyx-devel/ [2.1.x] > git push -n
> To [email protected]:lyx
>    f5a246b..66c96ce  2.1.x -> 2.1.x
>  ! [rejected]        master -> master (non-fast-forward)
> error: failed to push some refs to '[email protected]:lyx'
> hint: Updates were rejected because a pushed branch tip is behind its remote
> hint: counterpart. If you did not intend to push that branch, you
> may want to
> hint: specify branches to push or set the 'push.default' configuration
> hint: variable to 'current' or 'upstream' to push only the current branch.

I was not given that hint, but a seemingly unrelated error that initially
confused me before I noticed that it was also trying to push 2.0.x:
To [email protected]:lyx
   b17802b..f5a246b  2.1.x -> 2.1.x
 ! [rejected]        2.0.x -> 2.0.x (non-fast-forward)
error: failed to push some refs to '[email protected]:lyx'
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.

> You can set it only to push your current branch by doing:
> git config --global push.default current

Thanks. I will also do this for good measure. However, I see that
the 2.0.x branch is still around (maybe it's a zombie...):
$ git br
  2.0.x
* 2.1.x

Most probably, I have also to issue a "git -d 2.0.x" to completely
get rid of the thing. For good measure, I will also perform some
propitiatory rite...

-- 
Enrico

Reply via email to