head problem (bitbucket) push -f

James Reynolds james.glenn.reynolds at gmail.com
Wed Oct 18 17:46:25 UTC 2017


On Wed, Oct 18, 2017 at 1:20 PM, Uwe Brauer <oub at mat.ucm.es> wrote:

> Hi
>
> I thought control my local repos, but alas, I can't (again) push to
> bitbucket
>
> The message is
> abort: push creates new remote branches: year-2017-2018!
> (use 'hg push --new-branch' to create new remote branches)
>
> Which is ok since I have created a new branch
> hg push --new-branch
>
> Gives
>
>
> remote has heads on branch 'exam-sep-17' that are not known locally:
> 6ef15d23440d
> abort: push creates new remote head 9e3d909270e5 on branch 'exam-sep-17'!
> (pull and merge or see 'hg help push' for details about pushing new heads)
>
> Well in the local repo I have 7 named branches but 9 heads.
>
> I cloned the bitbucket repo and the problem seems to be in the
> exam-sep-17 branch.
>
> So in the bitbucket clone
>
> Hg log -b exam-sep-17 gives
>
> changeset:   372:fcdc0ba385ef
> branch:      exam-sep-17
>
>
> changeset:   370:9e3d909270e5
> branch:      exam-sep-17
> user:        Uwe Brauer <oub at mat.ucm.es>
> date:        Tue Oct 17 15:07:17 2017 +0200
> summary:     Upgrade header
>
>
>
> Which in the local branch I only have
>
>
> Hg log -b exam-sep-17 gives
> changeset:   370:9e3d909270e5
> branch:      exam-sep-17
> user:        Uwe Brauer <oub at mat.ucm.es>
> date:        Tue Oct 17 15:07:17 2017 +0200
> summary:     Upgrade header
>
> changeset:   369:5f607cb46909
> branch:      exam-sep-17
> parent:      367:cee65fe47a62
> user:        Uwe Brauer <oub at mat.ucm.es>
> date:        Tue Oct 17 15:06:12 2017 +0200
> summary:     Upgrade year
>
> changeset:   368:fcdc0ba385ef
> branch:      exam-sep-17
> user:        Uwe Brauer <oub at mat.ucm.es>
> date:        Sun Oct 15 21:36:23 2017 +0200
> summary:     Change structure HG file
>
> So I thought I run in local
>
> Hg up exam-sep-17
> hg pull -u
> hg merge
>
> And then hg push --new-branch.
>
> Is this a good idea, because I have to feeling I create more and more
> heads.
>
> Thanks
>
> Uwe Brauer
>
> _______________________________________________
> Mercurial mailing list
> Mercurial at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial
>


that looks mostly right to me, except i'm not sure why you need the new
branch?

I think all you need do in this case is:

hg up exam-sep-17;
hg pull;
hg merge;
`hg push -b .`

(note the . at the end is significant)

You are probably pushing from two sources (say a work computer and then a
home laptop)

You made some changes at "work" and your "laptop" doesn't know about them.

it's a good practice to do a `hg in` prior to working on new stuff to avoid
merges just to see if remote knows about stuff that your local doesn't.

You also probably don't need to do hg pull -u. In fact it may just confuse
things. Your going to get a new head when you pull.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20171018/fced5671/attachment-0002.html>


More information about the Mercurial mailing list