Git仓库管理自动化工具
Project description
yhgit
yhgit 是一款基于 Python 封装的关于 Git 的多仓库管理工具,可以高效,方便的对多个 Git 仓库执行 Git 命令。 适合于在多个仓库中进行关联开发的项目,提高 Git 操作的效率,避免逐个项目执行 Git 命令带来的误操作风险。
-
易用的命令 封装 Git 命令,命令和参数均由 Git 衍生而来,会使用 Git 就可以成本低上手 MGit。
-
直观高效的执行命令 提供图表化的结果展示,开发者可以快速查看命令在多个仓库的执行结果; 提供进度展示,开发者可以直观看到当前执行到哪个仓库;
-
安全的执行命令 在执行命令前对多仓库状态进行安全检查:分支是否异常,工作区是否未提交代码,是否有冲突,等;
快速开始
- ⚠ 确保Python版本最低为 3.7
- ⚠ 手动创建PodfileModule; 确保按PodfileModule文件介绍配置文件PodfileModule
- ⚠ 自动创建PodfileModule; 请执行yhgit init
- ⚠ 确保按配置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
- 修改Podfile文件 配置Podfile
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 中
-
根据文档配置 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/A及modules/B
4、进一步了解 yhgit
Project details
Release history Release notifications | RSS feed
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4d6e33f396e00a66d7ee09d112bbd3b93584998c698cef9be4781e0fd71e5bd
|
|
| MD5 |
37414bc0af60fb612b5cf34213db633b
|
|
| BLAKE2b-256 |
fdefdd5cf7e91c2eb0971b2c0db2a87e7356aafd1f5a11be183faa40078f5bed
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58bef2bdadedbc44822159be4eb06d9a137200dc10e0c070b0fb964d1ff369ee
|
|
| MD5 |
9bfcf2b060836757a7586c6e25325be9
|
|
| BLAKE2b-256 |
d68c900f545ec38ac2e06b9ccb6b838e5e7df6c27d3bcea760b8a473893652d6
|