CLI tool which simplifies Git usage with multiple online accounts/services.
Project description
GitProf
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.emailneed 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
pippackage 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 --helpto see parameters for theprofilesubcommand.
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/*
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 gitprof-1.1.1.tar.gz.
File metadata
- Download URL: gitprof-1.1.1.tar.gz
- Upload date:
- Size: 13.0 kB
- Tags: Source
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b98293cf0e47938ef93d4a7d86ff1b3a96da505879ec6042e7fbe9cab05e04fa
|
|
| MD5 |
14ecfca4b5999084edb73b253ddf5305
|
|
| BLAKE2b-256 |
dd7dd70fd18310a432ae71142158e378dd993dda43a0753f63b36ceddfd4c8be
|
File details
Details for the file gitprof-1.1.1-py3-none-any.whl.
File metadata
- Download URL: gitprof-1.1.1-py3-none-any.whl
- Upload date:
- Size: 23.6 kB
- Tags: Python 3
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
152cb8e12e02f5586216760ce096d02560dfcbe931f0b3742acadc7b6dfaf81d
|
|
| MD5 |
998753a03dc6ae3c7da083ef765d14f8
|
|
| BLAKE2b-256 |
0d85d250042b6fc211380ec36b6b69458f45e038692270f912cfe9b4d36435cc
|