Rewriting a GitHub repo #194
-
Docs are great, and they say:
Should I read this as proof that I can't force-push or use There are some other human-based considerations that you cover pretty well in the docs. Basically, I have a tiny team, and it's mostly just me using git day-to-day. I can make the others re-clone without too much issue I think, but I'd honestly like to keep the repo as intact as possible. What's generally the best alternative? I was thinking maybe rename and archive the original repo with a link. Part of me was hoping that I could rename My main goal for using |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Right, you'll be unable to remove refs/pull/* so the server side storage wouldn't actually shrink. refs/pull/* aren't cloned/fetched by default, so you could potentially choose to just "deal with it" and push the things that you can. Anyone that reclones would get the smaller size history, unless they also manually fetched refs/pull/. However, if there are any open pull requests at the time of the rewrite, attempting to merge them after rewriting history would cause you to combine the old and new histories (essentially ending up with two copies of all commits, one of the commits being ones that contained big high-churn files in their history). Also, anyone who fetched refs/pull/ and attempted to merge it would result in you having two combined histories. Once you have two combined histories, things get a bit messier to try to clean up, so I usually suggest people take efforts to avoid the problem and a new repository tends to help avoid it. However, a new repository is not strictly necessary. |
Beta Was this translation helpful? Give feedback.
Right, you'll be unable to remove refs/pull/* so the server side storage wouldn't actually shrink. refs/pull/* aren't cloned/fetched by default, so you could potentially choose to just "deal with it" and push the things that you can. Anyone that reclones would get the smaller size history, unless they also manually fetched refs/pull/. However, if there are any open pull requests at the time of the rewrite, attempting to merge them after rewriting history would cause you to combine the old and new histories (essentially ending up with two copies of all commits, one of the commits being ones that contained big high-churn files in their history). Also, anyone who fetched refs/pull/ and attem…