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
gitconfigparser.pyby looking-for-a-job @ GitHub
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e66f89978f399478c8fe24f01a75e1cf2cb705144fa33fdb10c41bf3ce06f0a
|
|
| MD5 |
4819fb0b5f9e482752f84304541390d4
|
|
| BLAKE2b-256 |
dde0df5cb19d9563a8673b58a4f44a839acba9f9e2465bdd571d947ddfeccf56
|
Provenance
The following attestation bundles were made for git_profile-1.1.4.tar.gz:
Publisher:
python.yaml on NiklasRosenstein/git-profile
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
git_profile-1.1.4.tar.gz -
Subject digest:
4e66f89978f399478c8fe24f01a75e1cf2cb705144fa33fdb10c41bf3ce06f0a - Sigstore transparency entry: 729851380
- Sigstore integration time:
-
Permalink:
NiklasRosenstein/git-profile@8512a7b3cbb3a10cd40b69b93ffc4dbbc4ef4848 -
Branch / Tag:
refs/tags/1.1.4 - Owner: https://github.com/NiklasRosenstein
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python.yaml@8512a7b3cbb3a10cd40b69b93ffc4dbbc4ef4848 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8cdb7ad6bf26698d8e4be94935e34f09309363dfe383230ae535abe1e861767
|
|
| MD5 |
ed4f834d826d6f0f687ad599b6c948ba
|
|
| BLAKE2b-256 |
5b11cfa0178cd63860ea54f3d14dc2a9075c1e0e2ab7d797cfe293be1b6d58fd
|
Provenance
The following attestation bundles were made for git_profile-1.1.4-py3-none-any.whl:
Publisher:
python.yaml on NiklasRosenstein/git-profile
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
git_profile-1.1.4-py3-none-any.whl -
Subject digest:
e8cdb7ad6bf26698d8e4be94935e34f09309363dfe383230ae535abe1e861767 - Sigstore transparency entry: 729851381
- Sigstore integration time:
-
Permalink:
NiklasRosenstein/git-profile@8512a7b3cbb3a10cd40b69b93ffc4dbbc4ef4848 -
Branch / Tag:
refs/tags/1.1.4 - Owner: https://github.com/NiklasRosenstein
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python.yaml@8512a7b3cbb3a10cd40b69b93ffc4dbbc4ef4848 -
Trigger Event:
push
-
Statement type: