Re: emacs.git 'master' reset

Sean Whitton <[email protected]> Mon, 27 Jul 2026 09:50:05 +0100
Newsgroups gmane.emacs.devel
Message-ID <[email protected]>
Eli Zaretskii [26/Jul  3:17pm +03] wrote:
>> From: Sean Whitton <[email protected]>
>> Cc: [email protected]
>> Date: Sun, 26 Jul 2026 12:57:46 +0100
>>
>> Eli Zaretskii [26/Jul  2:51pm +03] wrote:
>> > I did pull and push, but have no unpushed commits (AFAIK), so what
>> > should I do?
>>
>>     git reset --hard origin/master
>>
>> Sorry, should have mentioned this case.
>
> But currently "git status" says "ahead 10", presumably because I have
> commits from before emacs.git on Savannah was reset.  Won't the
> above command lose all those commits?  Or were they already re-pushed?

Others are suggesting lots of complex things which aren't necessary.

You are not actually "ahead 10".  Those 10 commits are the old 10
commits from before the rewrite, which Git thinks must be 10 commits you
made locally, because it doesn't see them remotely.

You can verify that the reset command is safe by doing

    git diff origin/master..HEAD

That should print just diff of the commit of Yuan's that was stripped.
As you know that's fine to drop, you can then confidently either

    git reset origin/master

which will leave you with Yuan's diff as uncommitted work, which you can
revert, or

    git reset --hard origin/master

which will discard all uncommitted work and reset your working tree to
exactly origin/master.

-- 
Sean Whitton