"Push creates new remote heads" and my humble workflow (kind of dummy question)

Tom Hindle tom_hindle at sil.org
Wed Jul 15 15:44:34 UTC 2020


On Wed, Jul 15, 2020 at 5:01 AM Victor Sudakov <vas at sibptus.ru> wrote:

> Dear Colleagues,
>
> I use a very simple workflow. I have a repository "in the cloud" (on a
> VPC) and 2 clones thereof: on the home machine and on the office
> machine. After committing some work at home, I push the changes, and
> next morning pull them sitting at the office machine. And vice versa.
>
> It all works usually fine except when it does not work quite the way I'd
> like it to. Sometimes it happens that when trying to push my commits
> into the cloud, I get the "push creates new remote heads" warning, and
> I'm forced to merge.
>
> It would be fine but often, after the merge, I see the same changeset
> twice in my history: one as a result of yesterday's commit and again the
> same changeset - as a result of the merge. It's aesthetically
> unpleasant.
>
> The worst is that I cannot catch what actions cause this situation.
> Perhaps my forgetting to do "pull -u" before commit, or maybe not.
>

Yes that is a likely explanation.


>
> What would you advise me to do to a) grok the problem and b) never
> repeate the mistake? I really don't want to see the identical changeset
> twice.
>

If you do get into that situation again, and want to avoid a merge, check
out rebase.
Here is a guide for thg, which will hopefully make it clear how it works:
https://stackoverflow.com/questions/57421626/how-to-rebase-in-tortoisehg


>
> An example: https://termbin.com/hww1
> The changesets 132 and 134 are identical.
>
> --
> Victor Sudakov,  VAS4-RIPE, VAS47-RIPN
> 2:5005/49 at fidonet http://vas.tomsk.ru/
> _______________________________________________
> Mercurial mailing list
> Mercurial at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20200715/6b7590e7/attachment-0002.html>


More information about the Mercurial mailing list