Skip to main content

A git extension to allow you manage multiple git profiles on your workstation

Project description

Git Profile Manager

A git extension to allow you manage multiple git profiles on your workstation. User profiles can have independent configurations. They can also share configurations.

Python 3 PyPI version Build Status License: MIT


Installation

using Pip

Git-profile-manager can be installed using the python pip tool.

pip3 install git-profile-manager

# pip install git-profile-manager

## Upgrade
pip3 install git-profile-manager --upgrade

NOTE: After installation, your current git config will be used as a shared configuration. All users inherit from the configuration

Usage

Create Profile

To create a profile

  git create-profile 

  git create-profile -e foo@bar.com -n "Foo Bar"

To Configure profile:

  # Sets up ssh for that user
  git config --global core.sshCommand "ssh -i /full/path/to/id_a/id_rsa"

NOTE: Git Profile Manager stores the user config as global config. Hence all configurations must carry the --global flag. That means running config without the --global flag creates a local config that overrides values set on user config

  # Sets up ssh for that user
  # Set config for present repository
  # This Config overrides the user profile created config value for core.sshCommand
  git config core.sshCommand "ssh -i /full/path/to/id_a/id_rsa"

All initial global configurations are added to the user config. For conflicts, the user's config override the global config.

Global Configuration

To add configurations that would be shared by all users:

  git global-config core.sshCommand "ssh -i /full/path/to/id_rsa"

User's configuration always override global configuration

Apply profile

Applies a profile to a particular directory. Once applied, any repository within the directory uses the config.

  # Applies current user profile 
  git apply-profile /home/user/company

  # Applies specified user profile
  git apply-profile /home/user/personal -u personal

implemented using https://git-scm.com/docs/git-config#_conditional_includes

Switch between Profiles

To Switch Profile:

  git use-profile foo@bar.com

Remove Existing Profile

To Remove an existing Profile:

  git remove-profile foo@bar.com

Current Profile

To get the Current Profile:

  git current-profile

List Profiles

To list the Current Profile:

  git list-profiles

TODO

  • Add bash completions
  • Check and add windows compatibility
  • Tests

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-manager-0.0.4.post1.tar.gz (7.2 kB view details)

Uploaded Source

File details

Details for the file git-profile-manager-0.0.4.post1.tar.gz.

File metadata

  • Download URL: git-profile-manager-0.0.4.post1.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.7

File hashes

Hashes for git-profile-manager-0.0.4.post1.tar.gz
Algorithm Hash digest
SHA256 4466c0666b87a9e610ed7b00e725e14cf7e0b7f13a229ed253e0d76cc59977bf
MD5 b595262c1927f2f11b7463d5f9fc5221
BLAKE2b-256 ca3af0441341e547b57e250dc5b8f84d776ad4781f02e5f5a0a2ec3f3afb05f0

See more details on using hashes here.

Supported by

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