Skip to main content

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

Project description


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.


We recommend installing the tool with Pipx.

$ pipx install git-profile


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.


  email = ""


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

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.


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.2.tar.gz (11.6 kB view hashes)

Uploaded source

Built Distribution

git_profile-1.1.2-py3-none-any.whl (12.0 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page