|
1 | 1 | # Mirror|rorriM |
2 | 2 |
|
3 | | -Still under construction |
| 3 | +## Motivation |
| 4 | + |
| 5 | +How many Git repos do you have? |
| 6 | +I have over 100 (but most of them are stale). |
| 7 | +Even in the last two weeks (when this was made), I'd edited over 10 different ones. |
| 8 | +They also rely on multiple configuration files that I frequently update (see all the ones in the root of this repo). |
| 9 | +How do I manage them all? |
| 10 | +I mirror them from a centralized config repo (https://github.com/George-Ogden/config). |
| 11 | + |
| 12 | +## Usage |
| 13 | + |
| 14 | +You have the same problem? Just follow these three steps: |
| 15 | + |
| 16 | +0. Install from GitHub: |
| 17 | + |
| 18 | +```bash |
| 19 | +uv pip install git+https://github.com/George-Ogden/mirror-rorrim |
| 20 | +``` |
| 21 | + |
| 22 | +(miss off the `uv` if you're still using `pip`). |
| 23 | + |
| 24 | +1. Make a configuration file called `.mirror.yaml` in the root of your repository (skip this step if you already have a config you want to use): |
| 25 | + |
| 26 | +```yaml |
| 27 | +repos: |
| 28 | + - source: <location of config files> # anything you can git clone ... |
| 29 | + files: |
| 30 | + - mypy.ini # shorthand for mypy.ini: mypy.ini |
| 31 | + - pytest.ini: pytest.ini # format is target: source |
| 32 | + - ruff.toml |
| 33 | + |
| 34 | + # add more sources in the same format to sync from multiple repos |
| 35 | + - source: https://github.com/github/gitignore |
| 36 | + files: |
| 37 | + - .gitignore: Python.gitignore |
| 38 | + |
| 39 | + - source: https://github.com/licenses/license-templates |
| 40 | + files: |
| 41 | + - LICENSE: templates/mit.txt |
| 42 | +``` |
| 43 | +
|
| 44 | +2. Install the mirror (make sure you've already run `git init`): |
| 45 | + |
| 46 | +```bash |
| 47 | +mirror install |
| 48 | +``` |
| 49 | + |
| 50 | +For more advanced options, including using a remote config, see the help text: |
| 51 | + |
| 52 | +```bash |
| 53 | +mirror install --help |
| 54 | +``` |
| 55 | + |
| 56 | +_After installing, it's a good idea to commit._ |
| 57 | + |
| 58 | +3. Periodically, sync your config files: |
| 59 | + |
| 60 | +```bash |
| 61 | +mirror sync |
| 62 | +``` |
| 63 | + |
| 64 | +Make updates in the repos you're syncing from. |
| 65 | +_You can still edit your local files manually, but you may need to resolve conflicts when you sync._ |
| 66 | + |
| 67 | +### Pre-Commit |
| 68 | + |
| 69 | +If you use, `pre-commit`, consider adding this repo as a hook to check for updates: |
| 70 | + |
| 71 | +```yaml |
| 72 | +- repo: https://github.com/George-Ogden/mirror-rorrim/ |
| 73 | + rev: v0.4.0 |
| 74 | + hooks: |
| 75 | + - id: mirror-check |
| 76 | +``` |
| 77 | + |
| 78 | +## Contributing |
| 79 | + |
| 80 | +Use GitHub for bugs/feature requests. |
0 commit comments