Skip to main content

Easily switch between Git configurations on a per-repository basis.

Project description

git-profile

This command-line tool allows you to define a set of configuration profiles that can be applied on a per-repository basis. The main use case is to swap the user details and signing key, but it's not limited to just that.

Installation

We recommend installing the tool with Pipx.

$ pipx install git-profile

Configuration

In ~/.gitconfig, prefixing section names with <Profile>. assigns them to the specified profile. Git-profile can use that information to determine which profiles there are and what configuration is associated with it.

Example:

[Work.user]
  email = "me@work.com"
  signingkey = DEADBEEFDEADBEEF

Usage

Run git profile to list available profiles. The current profile will be marked with a star. Note that the default profile is always present and represents your normal Git configuration without profile overrides.

$ git profile
* default
  Work

With git profile <Profile> you can switch to the specified profile.

$ git profile Work
Switched to profile "Work".

The changes will be applied to .git/config of the current repository.

You can add the --diff option to print a diff of the applied config changes.

FAQ

How do I avoid accidentally forgetting to switch my profile after checking out a repository?

You can leave the [user] section of your default configuration empty. That way Git will prompt you to configure it when trying to commit. Simply run git profile <Profile> after that and commit again.

Vendored Libraries


Copyright © 2012 Niklas Rosenstein

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git_profile-1.1.4.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

git_profile-1.1.4-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file git_profile-1.1.4.tar.gz.

File metadata

  • Download URL: git_profile-1.1.4.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for git_profile-1.1.4.tar.gz
Algorithm Hash digest
SHA256 4e66f89978f399478c8fe24f01a75e1cf2cb705144fa33fdb10c41bf3ce06f0a
MD5 4819fb0b5f9e482752f84304541390d4
BLAKE2b-256 dde0df5cb19d9563a8673b58a4f44a839acba9f9e2465bdd571d947ddfeccf56

See more details on using hashes here.

Provenance

The following attestation bundles were made for git_profile-1.1.4.tar.gz:

Publisher: python.yaml on NiklasRosenstein/git-profile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file git_profile-1.1.4-py3-none-any.whl.

File metadata

  • Download URL: git_profile-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for git_profile-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e8cdb7ad6bf26698d8e4be94935e34f09309363dfe383230ae535abe1e861767
MD5 ed4f834d826d6f0f687ad599b6c948ba
BLAKE2b-256 5b11cfa0178cd63860ea54f3d14dc2a9075c1e0e2ab7d797cfe293be1b6d58fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for git_profile-1.1.4-py3-none-any.whl:

Publisher: python.yaml on NiklasRosenstein/git-profile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page