Zulip Chat Archive

Stream: mathlib4

Topic: Dumb git question


Michael Stoll (Jun 04 2024 at 20:01):

By some mistake, my local master branch of Mathlib has two extra commits (that cancel each other out). Now whenever I make a new branch for a PR, the PR then shows these two commits at the beginning (e.g., #13510).
How do I get my local master back in sync with origin/master? (I tried git reset --hard, but that did not throw away these commits. I could set up a fresh clone, but there should be a better way I assume.)

Oliver Nash (Jun 04 2024 at 20:02):

I think git reset origin/master --hard should work.

Johan Commelin (Jun 04 2024 at 20:03):

You can pass origin/master as arg...

Oliver Nash (Jun 04 2024 at 20:03):

Be sure you don't have local changes you want to keep! See also https://xkcd.com/1597/

Michael Stoll (Jun 04 2024 at 20:04):

Thanks! This seems to have worked.


Last updated: May 02 2025 at 03:31 UTC