一个简化多个在线账户/服务的Git使用的命令行工具。
项目描述
GitProf
简介
GitProf("Git配置文件")是一个简化处理多个Git账户/服务的工具。
GitProf可以帮助你
- 使用不同的Git服务(例如GitHub和GitLab)。
- 在GitHub上使用多个账户(例如个人和工作账户)。
它解决了在使用多个账户/服务时可能遇到的问题
- 由于默认的SSH密钥属于不同的账户,您无法轻松地克隆仓库。
- 一旦您克隆了仓库,本地Git配置值,如
user.email
,需要设置正确。
GitProf不会改变您的Git工作流程;在仓库上使用gitprof clone
或gitprof profile apply
之后,您不需要再次与gitprof
交互。
安装
要求
- Python 3.7或更高版本,带有
pip
包管理器(通常默认安装)。 - Windows、Linux或macOS。
使用pip
安装时,gitprof
可执行文件将自动添加到PATH
中,并作为独立程序运行。
要使用pip
安装GitProf,请运行以下命令
pip install gitprof
现在您可以通过运行gitprof version
来检查它是否已安装并可在PATH
上使用。
快速入门
GitProf 存储了配置文件,其中包含配置不同账户所需的信息。当你运行使用配置文件的命令时,系统会提示你选择现有的配置文件或创建一个新的。
克隆新的仓库
要克隆仓库,只需使用 gitprof clone
而不是 git clone
。例如
>> 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.
将配置文件应用于现有仓库
如果你有一个现有的仓库,并希望更改其配置值,你可以进入仓库并使用 gitprof profile apply
。例如
>> 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'...
提示:GitProf 包含帮助信息,包括子命令。例如,你可以使用
gitprof profile --help
来查看profile
子命令的参数。
开发者说明
打包项目
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/*
项目详情
下载文件
下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。
源分发
gitprof-1.1.1.tar.gz (13.0 kB 查看哈希值)
构建分发
gitprof-1.1.1-py3-none-any.whl (23.6 kB 查看哈希值)
关闭
gitprof-1.1.1.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | b98293cf0e47938ef93d4a7d86ff1b3a96da505879ec6042e7fbe9cab05e04fa |
|
MD5 | 14ecfca4b5999084edb73b253ddf5305 |
|
BLAKE2b-256 | dd7dd70fd18310a432ae71142158e378dd993dda43a0753f63b36ceddfd4c8be |
关闭
gitprof-1.1.1-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 152cb8e12e02f5586216760ce096d02560dfcbe931f0b3742acadc7b6dfaf81d |
|
MD5 | 998753a03dc6ae3c7da083ef765d14f8 |
|
BLAKE2b-256 | 0d85d250042b6fc211380ec36b6b69458f45e038692270f912cfe9b4d36435cc |