[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] recover commits on mob

From: Danny Milosavljevic
Subject: Re: [Tinycc-devel] recover commits on mob
Date: Tue, 5 Jan 2021 19:35:35 +0100


On Tue, 5 Jan 2021 18:12:35 +0000
Ramsay Jones <ramsay@ramsayjones.plus.com> wrote:

> I just pushed a fix-up to the 'mob' branch to recover three
> commits which had been 'overwritten' somehow. (Danny, did
> you not see an error message when you tried to push?).

Thank you!

I've reconstructed what could have happened.

In the current tinycc-suggested workflow

  git push ssh://mob@repo.or.cz/srv/git/tinycc.git arm-asm:mob

it turns out that the colon separates the local branch from the upstream branch,
so, here, it pushes my branch "arm-asm" as the upstream branch "mob" (WTF!).
That sounds dangerous.  Also, it is not what I thought that does.

So I think what happened is that one time I force-pushed and overwrote the mob
branch with a command like the one above (sorry).  It should have only affected
a tiny bit though since I rebase arm-asm on top of mob.

In the future, I'll switch over to using this instead (while working
in the local "arm-asm" branch):

git checkout mob
git pull --rebase

git checkout arm-asm
git rebase mob

git checkout mob
git merge arm-asm
git push -u origin mob # the first time; later times just "git push".

That would make merges explicit and would thus be much safer.  Also, it's
how I use git elsewhere.

(I had never seen the foo:bar with URL push syntax before)

Attachment: pgpKHADKmXAB0.pgp
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]