Gotta Fetch 'Em All
  • Cython 98.1%
  • JavaScript 1.9%
2026-03-03 15:02:53 +00:00
assets Banner 2026-03-03 15:02:53 +00:00
.gitignore Initial 2026-02-20 08:33:46 +00:00
.nvmrc Initial 2026-02-20 08:33:46 +00:00
config.example.js Didn't mean to do that 2026-02-26 16:47:51 +00:00
index.js Fix import 2026-03-02 10:00:33 +00:00
readme.md Banner 2026-03-03 15:02:53 +00:00

Ash Fetchum - Gotta Fetch 'Em All

What does it do?

It gets a list of all your repositories on Forgejo or GitHub then either clones them if they don't exist, or fetches the most recent changes. Alternatively, you can define a list of repos and their SSH urls to clone just those.

Usage

Ash Fetchum supports Forgejo and GitHub because that's the two services I use. It should be easy enough to add other services but I don't use them, so I didn't. It assumes you clone and fetch your repositories via ssh and have that setup on the machine Ash Fetchum is running on. I built this as a way to backup all my repositories to my home server which is then backed up elsewhere.

To get started:

  1. Copy config.example.js as config.js or create a new config.js file.
  2. In that file, set up each service you want to clone repositories from and keep up to date. The example file shows what is required for each service. Pay attention to the permissions needed for tokens.
  3. Run npm install - I'm using v25 but it should work with lower versions anyway.
  4. Run node index.js to clone or fetch your repositories.
  5. Set up node index.js on a schedule to keep all your repos fresh.

You optionally pass a custom config path as the third argument if your config exists outside the root:

node index.js /my/custom/path/config.js

Warnings

  • If two services have a repo with the same name, only the first one will get cloned/fetched.

Adding other services

If one wanted to add another service, one need only to add a new if (service.type === 'new-service'), fetch repositories, then map them to an object like below and add that code to index.js.

{
    name: 'name-of-repo',
    sshUrl: 'git@example.com:username/name-of-repo.git',
    skip: false,
}