Skip to main content

GitProf

License: MIT PyPI PyPI - Python Version

Introduction

GitProf ("Git Profiles") is a tool which simplifies working with multiple Git accounts/services.

GitProf helps you with:

  • Using different Git services (e.g. GitHub and GitLab).
  • Using multiple accounts on GitHub (e.g. personal and work accounts).

It solves the problems which you may experience when using multiple accounts/services:

  • You can't clone a repository easily because your default SSH key is for a different account.
  • Once you clone the repository, local Git config values such as user.email need to be set correctly.

GitProf doesn't change your Git workflow; after using gitprof clone or gitprof profile apply on a repository, you don't need to interact with gitprof again for that repository.

Installation

Requirements:

  • Python 3.7 or higher, with the pip package manager (which is usually installed by default).
  • Windows, Linux or macOS.

When installed with pip, the gitprof executable is automatically added to the PATH and behaves as a standalone program.

To install GitProf with pip, run the command:

pip install gitprof

Now you can run gitprof version to check that it is installed and available on the PATH.

Quick Start

GitProf stores profiles which contain the information required to configure repositories for different accounts. When you run a command which uses a profile, you will be prompted to choose an existing profile or create a new one.

Cloning a new repository

To clone a repository, just use gitprof clone instead of git clone. For example:

>> gitprof clone git@gitlab.com/some-profile/some-repo.git

### Choose a profile to clone with ###
[0] github                         (GitHub)
[2] gitlab                         (GitLab)
[3] <CREATE NEW PROFILE>
Enter a number from the list to choose an option [default=0]: 1

Cloning 'git@gitlab.com/some-profile/some-repo.git' with profile: gitlab

Setting local Git config values for 'some-repo'...
Setting your Git name to 'MyUsername'...
Setting your Git email to 'MyGitEmail'...
Setting your Git SSH command to 'ssh -i ~/.ssh/my_ssh_key'...
Finished setting up your Git repository.

Applying a profile to an existing repository

If you have an existing repository whose config values you wish to change, you can cd into the repository and use gitprof profile apply. For example:

>> cd some-repo
>> gitprof profile apply

### Choose a profile to apply ###
[0] github                         (GitHub)
[2] gitlab                         (GitLab)
[3] <CREATE NEW PROFILE>
Enter a number from the list to choose an option [default=0]: 1

Setting local Git config values for 'some-repo'...
Setting your Git name to 'MyUsername'...
Setting your Git email to 'MyGitEmail'...
Setting your Git SSH command to 'ssh -i ~/.ssh/my_ssh_key'...

Tip: GitProf includes help info, even for subcommands. For example, you can use gitprof profile --help to see parameters for the profile subcommand.

Developer Notes

Packaging the project

rm -r dist/
python -m pip install -r requirements-dev.txt -r requirements.txt
python setup.py sdist
python setup.py bdist_wheel
twine upload dist/*

Metadata

Release files for gitprof 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gitprof 1.1.1
File Size Uploaded
gitprof-1.1.1.tar.gz 13.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gitprof 1.1.1
File Interpreter ABI Platform
gitprof-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 36.6 kB

Release files / gitprof-1.1.1.tar.gz

Download URL gitprof-1.1.1.tar.gz
Size 13.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b98293cf0e47938ef93d4a7d86ff1b3a96da505879ec6042e7fbe9cab05e04fa
BLAKE2b-256 checksum
How to use checksums
dd7dd70fd18310a432ae71142158e378dd993dda43a0753f63b36ceddfd4c8be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.2

Release files / gitprof-1.1.1-py3-none-any.whl

Download URL gitprof-1.1.1-py3-none-any.whl
Size 23.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
152cb8e12e02f5586216760ce096d02560dfcbe931f0b3742acadc7b6dfaf81d
BLAKE2b-256 checksum
How to use checksums
0d85d250042b6fc211380ec36b6b69458f45e038692270f912cfe9b4d36435cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.2

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page