Skip to main content

Git仓库管理自动化工具

Project description

yhgit

yhgit 是一款基于 Python 封装的关于 Git 的多仓库管理工具,可以高效,方便的对多个 Git 仓库执行 Git 命令。 适合于在多个仓库中进行关联开发的项目,提高 Git 操作的效率,避免逐个项目执行 Git 命令带来的误操作风险。

  • 易用的命令 封装 Git 命令,命令和参数均由 Git 衍生而来,会使用 Git 就可以成本低上手 MGit。

  • 直观高效的执行命令 提供图表化的结果展示,开发者可以快速查看命令在多个仓库的执行结果; 提供进度展示,开发者可以直观看到当前执行到哪个仓库;

  • 安全的执行命令 在执行命令前对多仓库状态进行安全检查:分支是否异常,工作区是否未提交代码,是否有冲突,等;

快速开始

  1. ⚠ 确保Python版本最低为 3.7
  2. ⚠ 手动创建PodfileModule; 确保按PodfileModule文件介绍配置文件PodfileModule
  3. ⚠ 自动创建PodfileModule; 请执行yhgit init
  4. ⚠ 确保按配置podfile 配置Podfile文件

1、安装 yhgit 工具

$ pip3 install yhgit

⚠ 注意第一次安装使用以上命令,要想安装最新版本请使用Pypi或者pip install --upgrade yhgit安装最新版本

2、准备

  • 用Git 将项目 Clone 到本地

  • 在根目录下,执行yhgit init或者新建PodfileModule.yaml 文件,格式如下

version: 1.0.0
branch:
dependencies:
- module: A
  pod: A
  version:
  git: git@xxx.xxx.cn:xxx/a.git
  branch:
  tag: 1.0.0
  configurations:
  path:
  inhibit_warnings: false

2、初始化多仓库

初始化多仓库使用 yghit install 命令;

类似于 Git 从远程 clone 新仓库, 会将多个仓库 clone 到本地;

下面通过一个 demo 体验一下 yhgit 命令:

# 2.1 根据PodfileModule.yaml中组件A配置的git,tag或者branch,新建开发分支 test
$ yhgit install -b test A

# 2.2 体验一下mgit命令
$ yhgit init -b xxx.git       切新的开发分支,并自动创建yaml文件
$ yhgit status                查看多个仓库状态
$ yhgit commit -m '提交信息'   提交多仓库的代码
$ yhgit pull                  拉取远端代码
$ yhgit push                  推送代码
$ yhgit release               自动release代码
$ yhgit merge -b master A     merge分支master到当前的开发分支

3、已有多仓库如何迁移到 yhgit 管理

  • 根据文档配置 PodfileModule.yaml

    将要管理的仓库都配置到 PodfileModule.yaml 中

  • 根据文档配置 Podfile

  • 使用 yhgit install -b test A B 初始化多仓库

    • 新建modules文件
    • 基于PodfileModule.yaml中组件组件A, B的配置信息, 新建开发分支test
    • 更新PodfileModule.yaml中组件组件A, B的配置信息, 依赖信息branch为test
    • 更新PodfileLocal.yaml中组件组件A, B的配置信息,依赖为path分别为modules/Amodules/B

4、进一步了解 yhgit

常用命令

PodfileModule文件介绍

配置podfile

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

imgit-0.1.0.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

imgit-0.1.0-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file imgit-0.1.0.tar.gz.

File metadata

  • Download URL: imgit-0.1.0.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for imgit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e4d6e33f396e00a66d7ee09d112bbd3b93584998c698cef9be4781e0fd71e5bd
MD5 37414bc0af60fb612b5cf34213db633b
BLAKE2b-256 fdefdd5cf7e91c2eb0971b2c0db2a87e7356aafd1f5a11be183faa40078f5bed

See more details on using hashes here.

File details

Details for the file imgit-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: imgit-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for imgit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 58bef2bdadedbc44822159be4eb06d9a137200dc10e0c070b0fb964d1ff369ee
MD5 9bfcf2b060836757a7586c6e25325be9
BLAKE2b-256 d68c900f545ec38ac2e06b9ccb6b838e5e7df6c27d3bcea760b8a473893652d6

See more details on using hashes here.

Supported by

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