https://github.com/beefsack/git-mirror
Host Git repository mirrors with ease
https://github.com/beefsack/git-mirror
Last synced: 4 months ago
JSON representation
Host Git repository mirrors with ease
- Host: GitHub
- URL: https://github.com/beefsack/git-mirror
- Owner: beefsack
- License: gpl-2.0
- Created: 2015-05-06T13:38:41.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-05-07T03:46:19.000Z (over 10 years ago)
- Last Synced: 2024-06-20T12:46:51.648Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 121 KB
- Stars: 109
- Watchers: 8
- Forks: 22
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# git-mirror - simple Git mirrors
`git-mirror` is designed to create and serve read-only mirrors of your Git repositories locally or wherever you choose. A recent GitHub outage reinforces the fact that developers shouldn't be relying on a single remote for hosting code.
A major design goal of `git-mirror` is that it should just work with as little configuration as possible.
## Get started
Download and extract the latest release from the [releases page](https://github.com/beefsack/git-mirror/releases).
Create `config.toml` similar to:
```toml
[[repo]]
Origin = "https://github.com/beefsack/git-mirror.git"
```
By default it will update the mirror every **15 minutes** and will serve the mirror over HTTP using port **8080**. You can specify as many repos as you want by having multiple `[[repo]]` sections.
Run `git-mirror` with the path to the config file:
```bash
$ ./git-mirror config.toml
2015/05/07 11:08:06 starting web server on :8080
2015/05/07 11:08:06 updating github.com/beefsack/git-mirror.git
2015/05/07 11:08:08 updated github.com/beefsack/git-mirror.git
```
Now you can clone from your mirror on the default port of `8080`:
```bash
$ git clone http://localhost:8080/github.com/beefsack/git-mirror.git
Cloning into 'git-mirror'...
Checking connectivity... done.
```
## Advanced configuration
See [the example config](example-config.toml) for more advanced configurations.
## Authentication and authorisation
If you wish to control access to the mirror or specific repositories, consider proxying to `git-mirror` using a web server such as Nginx.