gitfetcher

module
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2025 License: MIT

README

Git fetcher codecov

[!NOTE] WIP: this tool is usable but its API may change in breaking ways.

A lightweight CLI to create local copies of remote repositories.

Highlights:

  • Simple file-based configuration
  • gitweb-compatible local repositories
  • Automation-friendly, including secret handling

Quickstart

go install github.com/mtth/gitfetcher

Sample .gitfetcher.conf configuration (txtpb format):

  # Sync public repositories from their URL.
sources {
  from_url {
    url: "https://github.com/nodejs/node"

    # Optional override for the local path to the repository.
    path: "node"
  }
}

# Sync repositories available to a given GitHub authentication token. This is
# useful for example to sync all your personal repos.
sources {
  from_github_token {
    # A token with read access to repositories is required. It can either be
    # specified inline or via an environment variable (prefixing it with `$`).
    token: "$GITHUB_TOKEN"

    # Forks are excluded by default and can be included using via this option.
    # include_forks: true

    # It's also possible to filter by repository name by specifying one or
    # more filters, optionally including wildcards. A repository will be
    # synced if it matches at least one.
    # filters: "user/*"
    # filters: "user/prefix*"
  }
}

# More sources...

# Optional settings.
options {
  # Root folder where local repositories will be stored, relative to the
  # configuration file. Defaults to the configuration's enclosing directory.
  # root: "/path/to/.gitfetcher.conf"

  # Layout used for repositories. The default is a standard repository with a
  # work directory. It's possible to use bare repos instead with BARE_LAYOUT.
  # layout: BARE_LAYOUT
}

Then run gitfetcher sync in the folder containing the above configuration. See gitfetcher --help for the full list of available commands and options.

Directories

Path Synopsis
Package main implements the gitfetcher CLI.
Package main implements the gitfetcher CLI.
Package gitfetcher creates local mirrors from remote git repositories.
Package gitfetcher creates local mirrors from remote git repositories.
fspath
Package fspath enables more explicit type signatures for filesystem paths.
Package fspath enables more explicit type signatures for filesystem paths.
target
Package target provides a representation of local repositories, i.e.
Package target provides a representation of local repositories, i.e.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL