git-profiles
A CLI tool to manage multiple Git configuration profiles, allowing developers to switch between different identities and settings quickly. Profiles are stored persistently and can be applied to local Git repositories with ease.
Features
- Create, update, and delete Git config profiles.
- Set and unset key-value pairs in profiles (
user.name,user.email, etc.). - Apply a profile to the local Git repository.
- Duplicate existing profiles.
- List all available profiles and show profile contents.
- Cross-platform persistent storage using
platformdirs. - Input validation for safe keys and valid emails.
- Quiet mode for scripting or automation.
Installation
⚠️ Note: The recommended method is via pipx. If
pipxis not installed, you can fall back topipor other methods below.
1️⃣ Recommended: Install via pipx (isolated and global CLI)
pipx installs Python CLI tools in isolated environments while making them available system-wide.
This prevents conflicts with other Python packages and keeps your environment clean:
pipx install git-profiles
2️⃣ Alternative: Install via pip (inside a virtual environment recommended)
If pipx is not available, you can use pip. It is recommended to install inside a virtual
environment to avoid polluting your global Python packages:
# Optional: create a virtual environment
python3 -m venv ~/.venvs/git-profiles
source ~/.venvs/git-profiles/bin/activate
# Install the package
pip install git-profiles
3️⃣ Alternative: Install via Homebrew (macOS / Linux)
brew install nkaaf/tap/git-profiles
⚡ Makes
git-profilesglobally available. Recommended if you already manage packages with Homebrew.
4️⃣ Development Installation (Editable / Contributing)
Clone the repository and install in editable mode using uv:
git clone https://github.com/nkaaf/git-profiles.git
cd git-profiles
# Ensure dependencies match the lockfile
uv sync
⚡ This allows you to modify the source code while testing. Make sure
uvis installed; it manages dependencies and project commands.
Usage
After installation (via pipx, pip, Homebrew, or the development workflow), you can use
git-profiles in three ways:
- Global CLI (recommended fallback):
git-profiles <command>
- Git alias (preferred and automatically available if Git is installed):
git profiles <command>
💡 Tip: The Git alias integrates seamlessly with your workflow and is the most convenient way to run commands.
- Python module (for development or scripting):
python3 -m git_profiles <command>
💡 Examples below will show both the global CLI and Git alias variants.
Set a key-value pair in a profile
git-profiles set work user.name "Alice Example"
git-profiles set work user.email "alice@example.com"
# Git alias equivalent:
git profiles set work user.name "Alice Example"
git profiles set work user.email "alice@example.com"
Remove a key from a profile
git-profiles unset work user.email
# Git alias equivalent:
git profiles unset work user.email
Apply a profile to the local Git repository
git-profiles apply work
# Git alias equivalent:
git profiles apply work
This sets all the keys in the work profile for the current repository.
List all available profiles
git-profiles list
# Git alias equivalent:
git profiles list
Show all key-values of a profile
git-profiles show work
# Git alias equivalent:
git profiles show work
Remove an entire profile
git-profiles remove work
# Git alias equivalent:
git profiles remove work
Duplicate a profile
git-profiles duplicate work personal
# Git alias equivalent:
git profiles duplicate work personal
Creates a copy of the work profile named personal.
Options
-q,--quiet: Suppress normal output. Errors are still shown.
git-profiles -q apply work
# Git alias equivalent:
git profiles -q apply work
Development
💡 Prerequisite: Make sure you have uv installed on your system. It is the dependency manager used to install dev dependencies, manage Python interpreters, and run project commands.
Get your development environment ready in a few steps:
# 1. Install all development dependencies
uv sync --frozen
# 2. Install pre-commit git hooks
pre-commit install
💡 After this, your environment is ready to run tests, linting, and builds.
⚠️ Important: Always run commands via
uv run poe <script>(e.g.,uv run poe lint,uv run poe test). This ensures the correct uv-managed environment is used. Runningpoedirectly may fail if the environment isn’t active, especially on CI runners.
Linting
# Run all linting checks
uv run poe lint
ℹ️ This internally runs
pre-commitusing the uv-managed environment.
💡 Commits automatically trigger pre-commit hooks after
pre-commit install. If any hook fails (e.g., lint errors), the commit is blocked until fixed.
Testing
# Run all tests defined in pyproject.toml
uv run poe test
ℹ️ This internally runs
pytestusing the uv-managed environment. You can also run specific python tests withuv run poe test-<version>.
Building
You can build the git-profiles package locally for testing or distribution:
# Ensure your environment is synced
uv sync --frozen --group build --no-dev
# Build both wheel and source distribution
uv build
Metadata
Release files for git-profiles 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| git_profiles-0.3.0.tar.gz | 17.1 kB | With provenance | Details for git_profiles-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| git_profiles-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for git_profiles-0.3.0-py3-none-any.whl |
Total release size: 38.6 kB
Release files / git_profiles-0.3.0.tar.gz
| Download URL | git_profiles-0.3.0.tar.gz |
|---|---|
| Size | 17.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
853a09f21dba47a38140c2e190e63eed3fb123004d8d1ba7276017883e476907
|
|
BLAKE2b-256 checksum How to use checksums |
1032166709a7188d3a881c431a6caad0ba0dfd6ed98c32cc0a40b9b808fe67d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 12, 2026.
Transparency logRelease files / git_profiles-0.3.0-py3-none-any.whl
| Download URL | git_profiles-0.3.0-py3-none-any.whl |
|---|---|
| Size | 21.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
870fc01086f7d75a21955afa0838a228fa557a38eb1e2de78ee72a4c9c861c53
|
|
BLAKE2b-256 checksum How to use checksums |
6fb111e981f360dc9fc8d148795d222146dc4af911b4f98ed7bafd3cacd8c892
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 12, 2026.
Transparency logSecurity for git-profiles 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for git_profiles-0.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 12, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.