Manage, init and update the common stuff on all your Git repositories.
The envrc file is the main entry
- Once installed, it will clone the
repo managerrepo if not found - install, configure and sync the repo
- and update itself if needed
Prerequisite: direnv should be installed on your computer.
Then:
# Init a repo if you don't have one
git init
# Install repo manager
curl -O https://raw.githubusercontent.com/combostrap/repo-manager/refs/heads/main/envrc/.envrc
# Type enter to kick direnv in or reload
direnv reloadTo set the git user, you can set in your .bashrc the following env:
| Env with Organization | Env Without Organization |
|---|---|
RM_${ORGANIZATION_NAME}_EMAIL |
RM_EMAIL |
RM_${ORGANIZATION_NAME}_SIGNING_KEY |
RM_SIGNING_KEY |
See the Git User Configuration Script
The git hooks directory is configured to .git-hooks (See Git Hooks configuration scripts)
And the following hooks are synced in it:
- commit message hook - for commit lint check
- pre-commit - to check for out of sync branch
Install the common scripts in the PATH
Install the root editor config
Default .gitignore and .gitattributes are installed if not found.
Default License is installed if not found
For project only configuration, you can add your own direnv scripts in the PROJECT_ROOT/direnv.d directory.
All .sh files present in this directory will be sourced.
In your scripts, you can use the following env:
| Syntax | Description |
|---|---|
PROJECT_ROOT |
The root directory of the git repo (ie GIT_ROOT without submodule) |
ORGANISATION_ENV_NAME |
The organization name in an env format |
RM_PREFIX |
The resource manager prefix (ie RM) |
You can change the behavior of the envrc resource manager script by setting the following variable in
your shell profile, ~/.bashrc, or ~/.config/direnv/direnvrc, or ~/.envrc.local.
The ORGANISATION_NAME variable is optional.
| Environment | Default Value | Description |
|---|---|---|
RM_${ORGANIZATION_NAME}_DIR or RM_DIR |
$PROJET_ROOT/../repo-manager |
The local file system location of the resource manager repository clone |
RM_${ORGANIZATION_NAME}_URI or RM_URI |
https://github.com/combostrap/repo-manager | The URI location of the resource manager repository |
You can fork this repo and
- make it your own
- or create a pull request to contribute