{"id":37455573,"url":"https://github.com/nkaaf/git-profiles","last_synced_at":"2026-01-16T07:00:16.437Z","repository":{"id":319287008,"uuid":"1073952554","full_name":"nkaaf/git-profiles","owner":"nkaaf","description":"Managing Git profiles systemwide","archived":false,"fork":false,"pushed_at":"2026-01-12T03:18:49.000Z","size":1101,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-12T10:12:35.048Z","etag":null,"topics":["cli","git","profile"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nkaaf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-10T22:14:03.000Z","updated_at":"2026-01-12T03:18:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"7fbf32c1-4b38-46bc-aaba-c544cf2e2855","html_url":"https://github.com/nkaaf/git-profiles","commit_stats":null,"previous_names":["nkaaf/git-profiles"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/nkaaf/git-profiles","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkaaf%2Fgit-profiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkaaf%2Fgit-profiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkaaf%2Fgit-profiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkaaf%2Fgit-profiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nkaaf","download_url":"https://codeload.github.com/nkaaf/git-profiles/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkaaf%2Fgit-profiles/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28477989,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","git","profile"],"created_at":"2026-01-16T07:00:14.456Z","updated_at":"2026-01-16T07:00:16.319Z","avatar_url":"https://github.com/nkaaf.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-profiles\n\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/nkaaf/git-profiles/main.svg)](https://results.pre-commit.ci/latest/github/nkaaf/git-profiles/main)\n![PyPI - Status](https://img.shields.io/pypi/status/git-profiles)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/git-profiles?logo=python)\n![PyPI - License](https://img.shields.io/pypi/l/git-profiles)\n![Codecov](https://img.shields.io/codecov/c/github/nkaaf/git-profiles?logo=codecov\u0026logoColor=%23b\u0026link=https%3A%2F%2Fcodecov.io%2Fgh%2Fnkaaf%2Fgit-profiles)\n\n![PyPI - Version](https://img.shields.io/pypi/v/git-profiles?logo=pypi\u0026link=https%3A%2F%2Fpypi.org%2Fproject%2Fgit-profiles%2F)\n\nA **CLI tool to manage multiple Git configuration profiles**, allowing developers to switch between\ndifferent identities and settings quickly. Profiles are stored persistently and can be applied to\nlocal Git repositories with ease.\n\n---\n\n## Features\n\n- Create, update, and delete Git config profiles.\n- Set and unset key-value pairs in profiles (`user.name`, `user.email`, etc.).\n- Apply a profile to the local Git repository.\n- Duplicate existing profiles.\n- List all available profiles and show profile contents.\n- Cross-platform persistent storage using `platformdirs`.\n- Input validation for safe keys and valid emails.\n- Quiet mode for scripting or automation.\n\n---\n\n## Installation\n\n\u003e ⚠️ **Note:** The recommended method is via **pipx**. If `pipx` is not installed, you can fall back\n\u003e to `pip` or other methods below.\n\n---\n\n### 1️⃣ Recommended: Install via **pipx** (isolated and global CLI)\n\n`pipx` installs Python CLI tools in isolated environments while making them available system-wide.\nThis prevents conflicts with other Python packages and keeps your environment clean:\n\n```bash\npipx install git-profiles\n```\n\n---\n\n### 2️⃣ Alternative: Install via **pip** (inside a virtual environment recommended)\n\nIf `pipx` is not available, you can use `pip`. It is recommended to install inside a virtual\nenvironment to avoid polluting your global Python packages:\n\n```bash\n# Optional: create a virtual environment\npython3 -m venv ~/.venvs/git-profiles\nsource ~/.venvs/git-profiles/bin/activate\n\n# Install the package\npip install git-profiles\n```\n\n---\n\n### 3️⃣ Alternative: Install via **Homebrew** (macOS / Linux)\n\n```bash\nbrew install nkaaf/tap/git-profiles\n```\n\n\u003e ⚡ Makes `git-profiles` globally available. Recommended if you already manage packages with\n\u003e Homebrew.\n\n---\n\n### 4️⃣ Development Installation (Editable / Contributing)\n\nClone the repository and install in **editable mode** using `uv`:\n\n```bash\ngit clone https://github.com/nkaaf/git-profiles.git\ncd git-profiles\n\n# Ensure dependencies match the lockfile\nuv sync\n```\n\n\u003e ⚡ This allows you to modify the source code while testing. Make sure `uv` is installed; it manages\n\u003e dependencies and project commands.\n\n---\n\n## Usage\n\nAfter installation (via pipx, pip, Homebrew, or the development workflow), you can use\n`git-profiles` in **three ways**:\n\n1. **Global CLI (recommended fallback):**\n\n```bash\ngit-profiles \u003ccommand\u003e\n```\n\n2. **Git alias (preferred and automatically available if Git is installed):**\n\n```bash\ngit profiles \u003ccommand\u003e\n```\n\n\u003e 💡 **Tip:** The Git alias integrates seamlessly with your workflow and is the most convenient way\n\u003e to run commands.\n\n3. **Python module (for development or scripting):**\n\n```bash\npython3 -m git_profiles \u003ccommand\u003e\n```\n\n\u003e 💡 Examples below will show both the **global CLI** and **Git alias** variants.\n\n---\n\n### Set a key-value pair in a profile\n\n```bash\ngit-profiles set work user.name \"Alice Example\"\ngit-profiles set work user.email \"alice@example.com\"\n\n# Git alias equivalent:\ngit profiles set work user.name \"Alice Example\"\ngit profiles set work user.email \"alice@example.com\"\n```\n\n### Remove a key from a profile\n\n```bash\ngit-profiles unset work user.email\n\n# Git alias equivalent:\ngit profiles unset work user.email\n```\n\n### Apply a profile to the local Git repository\n\n```bash\ngit-profiles apply work\n\n# Git alias equivalent:\ngit profiles apply work\n```\n\nThis sets all the keys in the `work` profile for the current repository.\n\n### List all available profiles\n\n```bash\ngit-profiles list\n\n# Git alias equivalent:\ngit profiles list\n```\n\n### Show all key-values of a profile\n\n```bash\ngit-profiles show work\n\n# Git alias equivalent:\ngit profiles show work\n```\n\n### Remove an entire profile\n\n```bash\ngit-profiles remove work\n\n# Git alias equivalent:\ngit profiles remove work\n```\n\n### Duplicate a profile\n\n```bash\ngit-profiles duplicate work personal\n\n# Git alias equivalent:\ngit profiles duplicate work personal\n```\n\nCreates a copy of the `work` profile named `personal`.\n\n---\n\n### Options\n\n* `-q`, `--quiet`: Suppress normal output. Errors are still shown.\n\n```bash\ngit-profiles -q apply work\n\n# Git alias equivalent:\ngit profiles -q apply work\n```\n\n---\n\n## Development\n\n\u003e 💡 **Prerequisite:** Make sure you have **uv installed** on your system. It is the dependency\n\u003e manager used to install dev dependencies, manage Python interpreters, and run project commands.\n\nGet your development environment ready in a few steps:\n\n```bash\n# 1. Install all development dependencies (pytest, tox, ruff, pre-commit, etc.)\nuv sync\n\n# 2. Install pre-commit git hooks\npre-commit install\n```\n\n\u003e 💡 After this, your environment is ready to run tests, linting, and builds.\n\n\u003e ⚠️ **Important:** Always run commands via `uv run poe \u003cscript\u003e` (e.g., `uv run poe lint`,\n`uv run poe test`).\n\u003e This ensures the correct uv-managed environment is used. Running `poe` or `tox` directly may fail\n\u003e if the environment isn’t active, especially on CI runners.\n\n---\n\n### Linting\n\n```bash\n# Run all linting checks\nuv run poe lint\n```\n\n\u003e ℹ️ This internally runs `pre-commit` using the uv-managed environment.\n\u003e 💡 Commits automatically trigger pre-commit hooks after `pre-commit install`.\n\u003e If any hook fails (e.g., lint errors), the commit is blocked until fixed.\n\n---\n\n### Testing\n\n```bash\n# Run all test environments defined in pyproject.toml\nuv run poe test\n```\n\n\u003e ℹ️ This internally runs `tox` using the uv-managed environment.\n\u003e ⚠️ **Note:** Tox requires the Python interpreters listed in `[tool.tox].envlist`.\n\u003e With the `tox-uv` plugin, missing interpreters are installed automatically.\n\u003e You can also install specific Python versions manually with `uv python install \u003cversion\u003e`.\n\n---\n\n### Building\n\nYou can build the `git-profiles` package locally for testing or distribution:\n\n```bash\n# Ensure your development environment is synced\nuv sync\n\n# Build both wheel and source distribution\nuv build\n```\n\n\u003e ⚡ Using `uv sync` ensures that all development dependencies are available during the build\n\u003e process.\n\n---\n\n### References / Helpful Links\n\nFor more information on the tools used in this project, you can visit their official documentation:\n\n* **[uv](https://docs.astral.sh/uv/)** – Dependency manager for Python projects, used here to\n  manage dev dependencies and Python interpreters.\n* **[tox](https://tox.wiki/)** – Automate testing across multiple Python versions.\n* **[pre-commit](https://pre-commit.com/)** – Manage and run pre-commit hooks to ensure code\n  quality.\n* **[Poe the Poet](https://poethepoet.natn.io/)** – Task runner that simplifies running\n  scripts (like `lint` and `test`) defined in `pyproject.toml`.\n* **[pipx](https://pipx.pypa.io/stable/)** – Install and run Python CLI tools in isolated\n  environments while making them available globally.\n* **[Python Packaging Guide](https://packaging.python.org/en/latest/tutorials/packaging-projects/)**\n  – Official guide for building, packaging, and distributing Python projects, including creating\n  source distributions and wheels.\n* **[Homebrew](https://brew.sh/)** – Popular package manager for macOS and Linux, used to install\n  CLI tools and dependencies system-wide.\n\n\u003e 💡 These links provide detailed documentation, installation guides, and examples for each tool.\n\u003e They’re especially useful if you’re new to Python project tooling.\n\n---\n\n## CI / GitHub Actions\n\nThe repository’s CI pipelines automatically run:\n\n* Tests across all Python versions defined in `[tool.tox].envlist`\n* Pre-commit hooks for linting and code quality\n\n\u003e ✅ This ensures that every commit and pull request is tested and checked consistently with your\n\u003e local development setup.\n\n---\n\n## License\n\nApache License 2.0 – see [LICENSE](LICENSE) for details.\n\n---\n\n## Acknowledgements\n\nThis project depends on the following open source libraries:\n\n- [filelock](https://github.com/tox-dev/filelock) - The Unlicense\n- [platformdirs](https://github.com/tox-dev/platformdirs) — MIT License\n- [pydantic](https://github.com/pydantic/pydantic) — MIT License\n- [typing-extensions](https://github.com/python/typing_extensions) - PSF-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnkaaf%2Fgit-profiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnkaaf%2Fgit-profiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnkaaf%2Fgit-profiles/lists"}