r/github • u/topi_shukla • Jun 20 '26
Question Question regarding backups and force commits
Say I am working on a private repo (i am the owner), with 5 members with write access free tier. Someone decides to erase everything with force commits and history. What can I do ? And let's also say I cant access to any local clones to make this problem interesting.
0
Upvotes
12
u/QuarterBall Jun 20 '26
This exact scenarios is why branch protection policies exist. Your main branches should reject force-pushes OR you should be backing up (syncing with GH actions or similar) your repos to another copy if this is a concern you have.
3
u/Noch_ein_Kamel Jun 20 '26
Well. For that case you have a backup.
https://docs.github.com/en/repositories/archiving-a-github-repository/backing-up-a-repository
3
u/throwaway234f32423df Jun 20 '26
If there are no local clones, how is anybody getting anything done to begin with?
1
u/AlexDjangoX Jun 25 '26
I have a similar situation.
Everyday I simple git clone the repo. Most I'll ever lose is a days work.
-1
u/kexnyc Jun 20 '26
First, learn a valuable lesson here. Second, see if you can find a recent clone somewhere. Claude suggests:
Hunt for any surviving clone or partial copy
This is where you should be aggressive before assuming total loss:
.gitfolder.