Ok I just ran git --mirror
when I meant to just update one branch
how do I undo that
this somehow closed a bunch of open pull requests
what did you run exactly? from what I'm seeing mirror would just clone in a special way, but not modify the original
though maybe it does
also, why mirror the repo?
just git push --mirror
git push --mirror
git status
git add .
git checkout . --ours
git rebase --continue
git rebase -i refactor/backend-options
git checkout refactor/no-panic
nix-shell
I tried to force-update current branch but used the wrong command
I think it reverted the history to the last time I pulled the repository
I'm really sorry!
I think I recovered all the commits and tags, but lost all the branch names and tag names.
github also seems to just still have commits and stuff
only thing is that authors need to re-open PRs that were automatically closed
so, nothing seems lost unless I'm missing something
ohhh, so I guess that command closed PRs because it deleted the branches on the remote, and since we all use the same remote so CI works… tada! OK, mystery solved.
I'll go through and undelete/reopen a bunch of these to get us closer to normal.
You can use git push --all
to update remote branches that I deleted or reverted.
I can restore branches but not re-open PRs that are not my own
@Locria Cyber so far github itself seems to have all the data still, so I'd prefer using that over pushing "global" git commands
Folkert de Vries said:
Locria Cyber so far github itself seems to have all the data still, so I'd prefer using that over pushing "global" git commands
git push --all
update all the branch names
I'm boopin' the buttons now. Found out there's a query for when something closed. Looks like only 20 PRs or so? Easy.
I basically deleted all the remote branches that are not in my local repository.
right so I think you don't need to do anything @Locria Cyber
we can restore from github
Doesn't Github have all the branch names?
not sure what you mean. All PRs are reopened now and they seem to have their original branch name. You mean branches that did exist but did not have PRs associated with them?
Yes
@Brian Hicks does git push --all
seem safe to you?
nooooooooooooooooooooooo
git is chock full of footguns
I've just finished boopin' the UI buttons to restore branches
I think tags get pulled automatically so we should be able to do git push --tags
to restore those
but I definitely just caused a build storm by reopening all the PRs so let's wait a bit so the queue can calm down
right, let's not touch anything for a while then
I hadn't considered branches without PRs, though (hadn't caught up before your @-mention) You're right that that one's tricky. git push --all
may fix it, but only for the subset of branches/commits that's on each of our machines. I'm inclined to say that if someone had some WIP that didn't make it to PR, they should just push the latest and make a draft PR.
also @Locria Cyber please don't worry too much about this—git makes it all too easy to get into situations like this, so GH and friends have made restores easier than they would be otherwise. The disruption here should be pretty minimal.
ok
I think git user account has limited access control
unfortunately, it really doesn't :grimacing:
I guess I'd sum it up by saying "git happens"
I see a bunch of rescue_HASH
branches in the branch explorer. Did one of you push those?
oooh, looks like we need to restore the www
branch to fix https://github.com/rtfeldman/roc/pull/1802
I probably have that branch locally, I pulled basically right before this happened. What do I do? just a git push?
a git push -u origin HEAD
from that particular branch would be the most sure-fire way
ok, did that
ok, I think that's the last of the closed PRs.
looks like we're still ~45 builds deep in the queue so waiting to push more would be good
unless there's any of these workflows we can just cancel? I know it's gonna take a bite out of the quota https://github.com/rtfeldman/roc/actions
there are some that I'm pretty sure will fail
We're all self-hosted, I'll close some that I know can be closed.
oh! I didn’t know we were completely self-hosted. I thought it was just benchmarks!
I've made issue #1868 to see what steps can be taken to prevent this in the future as well as how we can setup a workflow to restore things quickly in case things do go wrong.
Folkert de Vries said:
I probably have that branch locally, I pulled basically right before this happened. What do I do? just a git push?
git reflog show
will show the past change of branch/HEAD point to which commits
Then you can do git merge <commit hash>
from a branch
I got it that branch should be good now
oh ok, I was like wth happened lol
Last updated: Jul 06 2025 at 12:14 UTC