4

We have hundreds of archived repos on github which is no longer in use.

There is no option on Github to hide archived repos by default. Currently, it is not user-friendly to go through active repos, especially a lot of scrolling on github.

I like to create a new repo called Archived and move a lot of archived repos to that repo but is that possible? As I understand we can't have multiple repos in a repo Archived. If not, what are other options?

I'll-Be-Back
  • 10,530
  • 37
  • 110
  • 213
  • [I did do what you are thinking of](https://github.com/kitswas/archive), but note, those subprojects are not stored as git repositories. You can surely store your repositories after you remove the .git folder in them. You may also consider storing the archived git repos using [subversion](https://subversion.apache.org/). Add one repository per revision. – Kitswas Jun 16 '22 at 16:48
  • @Kitswas Removing .git folder will lose git commits history – I'll-Be-Back Jun 16 '22 at 16:51
  • I have not tested the strategy of using a different VCS to store git repos. Keep in mind that this will require you to move away from GitHub. – Kitswas Jun 16 '22 at 16:57
  • Also see [How do I work with a git repository within another repository?](https://stackoverflow.com/q/1811730/8659747) The subtree merge strategy seems suitable for you. – Kitswas Jun 16 '22 at 17:00
  • You *can* rename `.git` to something else, and then store that whole thing in a repository. Rename it back to `.git` to use it. This is (a) clumsy and (b) space-inefficient, as Git tries to compress already-compressed stuff, which makes it bigger. Don't do it: *can* does not mean *wise* (Ask anyone who has leapt a lot of river chasms via motorcycle, for instance: there's always at least one jump that didn't work. Then again, some say "bones heal, pain is temporary, and chicks dig scars"...) – torek Jun 16 '22 at 20:39

1 Answers1

2

There are a few things you can do:

  • GitHub has star lists where you can categorize starred repositories. You can create a list of archived repositories by starring all archivable repositories and adding them to a custom list.
  • Create a repository with each folder being a submodule of a to-be archived repository. This way, the commit history can be updated and this repository is a place to access all of the data without copying the files. The archived repositories would still have to exist, although they can be on any git hosting site.
  • If they're all repos with one branch, you can make a repository with an orphaned branch for each project. This means you won't be able to see the files easily but they'll be stored on GitHub.

The third option, or any method of storing the content of the git repositories in one folder or repository, would lead to a lot of loss of data and should be avoided if possible.