https://github.com/mtth/gitfetcher
Sync remote git repositories
https://github.com/mtth/gitfetcher
git golang
Last synced: about 2 months ago
JSON representation
Sync remote git repositories
- Host: GitHub
- URL: https://github.com/mtth/gitfetcher
- Owner: mtth
- License: mit
- Created: 2024-10-19T17:23:19.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-21T01:47:25.000Z (over 1 year ago)
- Last Synced: 2024-10-21T23:10:13.066Z (over 1 year ago)
- Topics: git, golang
- Language: Go
- Homepage:
- Size: 32.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Git fetcher [](https://codecov.io/gh/mtth/gitfetcher)
> [!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
```sh
go install github.com/mtth/gitfetcher
```
Sample `.gitfetcher.conf` configuration ([`txtpb` format][txtpb]):
```pbtxt
# 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.
[txtpb]: https://protobuf.dev/reference/protobuf/textformat-spec/