- C# 90.6%
- Shell 5.9%
- Batchfile 3.1%
- PowerShell 0.4%
|
All checks were successful
Continous Integration / build-and-test (push) Successful in 25s
Reviewed-on: #4 |
||
|---|---|---|
| .forgejo/workflows | ||
| build | ||
| src | ||
| .gitignore | ||
| build.ps1 | ||
| build.sh | ||
| CLAUDE.md | ||
| install.bat | ||
| install.sh | ||
| README.md | ||
GCM - Git Configuration Manager
A CLI tool that manages different named git configurations and applies them on demand.
Installation
Download the latest release for your platform and put the gcm binary on your PATH.
Linux / macOS
curl -fsSL https://git.mmtsc.de/marvinmees/GCM/raw/branch/main/install.sh | sh
Installs gcm to ~/.local/bin and marks it executable. Override the target with
GCM_INSTALL_DIR, or pin a version with GCM_VERSION (e.g. v1.2.0).
Windows
Download and run install.bat, or from a terminal:
curl -fsSL https://git.mmtsc.de/marvinmees/GCM/raw/branch/main/install.bat -o install.bat && install.bat
Installs gcm.exe to %LOCALAPPDATA%\Programs\gcm. The same GCM_INSTALL_DIR and
GCM_VERSION overrides apply.
Manual
Grab the binary for your OS/architecture (linux-x64, linux-arm64, osx-x64,
osx-arm64, win-x64) from the releases page,
rename it to gcm (gcm.exe on Windows), mark it executable, and put it on your PATH.
Usage
gcm add --name <name> Add a new configuration interactively
gcm remove <name> Remove a named configuration
gcm apply <name> Apply a configuration in the current directory
gcm list List saved configurations
gcm auto Auto-detect and apply config matching remote hostnames
The add command opens an interactive browser of git config settings organized by category. For each setting you pick, you are prompted for a value:
- String settings get a text prompt
- Boolean settings (e.g.
core.ignorecase) show atrue/falseradio selection - Multi-choice settings (e.g.
color.ui) show available options as radio buttons - A Custom key option lets you enter any arbitrary key-value pair
Examples
# Create a "Github" profile (browse categories, pick settings, enter values)
gcm add --name Github
# Remove a profile
gcm remove Github
# Apply the profile in the current repo
gcm apply github
# List all profiles
gcm list
The apply (and auto) commands run git config <key> <value> for each entry in the profile in the current working directory. The current directory must be inside a git repository.
The auto command inspects the repository's remotes (e.g. github.com, gitlab.com), looks for a saved configuration whose name matches the hostname (case-insensitive), and applies it. If multiple configurations match, you are prompted to choose.
Configurations are stored at ~/.config/gcm/configs.json.