跳转到主要内容

一个简化多个在线账户/服务的Git使用的命令行工具。

项目描述

GitProf

License: MIT PyPI PyPI - Python Version

简介

GitProf("Git配置文件")是一个简化处理多个Git账户/服务的工具。

GitProf可以帮助你

  • 使用不同的Git服务(例如GitHub和GitLab)。
  • 在GitHub上使用多个账户(例如个人和工作账户)。

它解决了在使用多个账户/服务时可能遇到的问题

  • 由于默认的SSH密钥属于不同的账户,您无法轻松地克隆仓库。
  • 一旦您克隆了仓库,本地Git配置值,如user.email,需要设置正确。

GitProf不会改变您的Git工作流程;在仓库上使用gitprof clonegitprof 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 查看哈希值)

上传时间 Python 3

由以下机构支持

AWSAWS 云计算和安全赞助商 DatadogDatadog 监控 FastlyFastly CDN GoogleGoogle 下载分析 MicrosoftMicrosoft PSF 赞助商 PingdomPingdom 监控 SentrySentry 错误记录 StatusPageStatusPage 状态页面