m-git 2.5.4 → 2.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +42 -16
- data/lib/m-git/command/config.rb +2 -2
- data/lib/m-git/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 232bed3ac9b0a7f3afe26d8e7796ce9131b4e7c2880aaafcb063c3ba909d4d14
|
4
|
+
data.tar.gz: 9f87f16862c5b7b63e7d37c46fcb4b84305794b93465b63c844c41851d999255
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81c73e2475e07efbaa1ae6dd218797bbef22e0f8b79ab07965bcdbb902b08bb407d5c91967178fcc4361568f89884a4b952bb9669c2d7bd5bed4a9947913f889
|
7
|
+
data.tar.gz: 2ac247bc413df36213b3dd3a0081893c416050f9cffc50cbd8df5494cfecb0955fdaf2ca37b86eb9219878d2753f7820fc787288fb0a22f4312c39f33e4ee0fb
|
data/README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# MGit
|
2
2
|
|
3
|
-
MGit是一款
|
4
|
-
适合于在多个仓库中进行关联开发的项目,提高
|
3
|
+
MGit 是一款 Ruby 封装的基于 Git 的多仓库管理工具,可以高效的、同时的对多个 Git 仓库执行 Git 命令。
|
4
|
+
适合于在多个仓库中进行关联开发的项目,提高 Git 操作的效率,避免逐个执行 Git 命令带来的误操作风险。
|
5
5
|
|
6
6
|
- **易用的命令**
|
7
|
-
封装Git命令,命令和参数均由Git衍生而来,会使用Git就可以成本低上手MGit。
|
7
|
+
封装 Git 命令,命令和参数均由 Git 衍生而来,会使用 Git 就可以成本低上手 MGit。
|
8
8
|
|
9
9
|
- **直观高效的执行命令**
|
10
10
|
提供图表化的结果展示,开发者可以快速查看命令在多个仓库的执行结果;
|
@@ -12,20 +12,20 @@ MGit是一款ruby封装的基于Git的多仓库管理工具,可以高效的、
|
|
12
12
|
|
13
13
|
- **安全的执行命令**
|
14
14
|
在执行命令前对多仓库状态进行安全检查:分支是否异常,工作区是否未提交代码等;
|
15
|
-
|
15
|
+
对 .git 进行托管与 Git 工作区分类,避免误删丢失改动或提交;
|
16
16
|
执行存在风险的操作时,会给与风险操作提示,避免误操作;
|
17
17
|
|
18
18
|
- **方便扩展**
|
19
|
-
支持加载ruby-gem包作为插件,gem包名格式 `m-git-${suffix}`和`mgit-${suffix}`
|
20
|
-
快速的扩展MGit的命令,增加自定义命令,扩展已有命令的功能;
|
21
|
-
提供类似`git hook`的 hook点,方便开发者实现自定义逻辑;
|
19
|
+
支持加载 ruby-gem 包作为插件,gem 包名格式 `m-git-${suffix}`和`mgit-${suffix}`
|
20
|
+
快速的扩展 MGit 的命令,增加自定义命令,扩展已有命令的功能;
|
21
|
+
提供类似`git hook`的 hook 点,方便开发者实现自定义逻辑;
|
22
22
|
|
23
23
|
## 快速开始
|
24
|
-
#### 1、安装MGit工具
|
24
|
+
#### 1、安装 MGit 工具
|
25
25
|
|
26
26
|
环境要求:
|
27
27
|
|
28
|
-
- 系统:支持 macOS、Ubuntu,暂时不支持
|
28
|
+
- 系统:支持 macOS、Ubuntu,暂时不支持 Windows
|
29
29
|
- Ruby版本: >= 2.3.7
|
30
30
|
|
31
31
|
```ruby
|
@@ -38,21 +38,45 @@ $ gem install m-git
|
|
38
38
|
|
39
39
|
类似于 Git 从远程 clone 新仓库, 会将多个仓库 clone 到本地;
|
40
40
|
|
41
|
-
下面通过一个demo体验一下MGit命令:
|
41
|
+
下面通过一个 demo 体验一下 MGit 命令:
|
42
42
|
|
43
43
|
```ruby
|
44
44
|
# 2.1 建议在一个新文件夹中拉取demo
|
45
45
|
$ mgit init -g https://github.com/baidu/m-git.git
|
46
46
|
|
47
47
|
# 2.2 体验一下mgit命令
|
48
|
-
$ mgit -l 显示所有
|
48
|
+
$ mgit -l 显示所有mgit管理的仓库
|
49
49
|
$ mgit branch --compact 查看多仓库的分支
|
50
50
|
$ mgit status 产看仓库分支超前/落后情况
|
51
51
|
```
|
52
52
|
|
53
53
|
|
54
|
+
#### 3、已有多仓库如何迁移到 MGit 管理
|
54
55
|
|
55
|
-
|
56
|
+
- 根据文档[配置 manifest.json](docs/config/manifest.md)
|
57
|
+
|
58
|
+
将要管理的仓库都配置到 manifest.json 中
|
59
|
+
|
60
|
+
- 将 manifest.json 放到一个仓库中管理
|
61
|
+
|
62
|
+
这个仓库同样会在 manifest.json 中描述,并且需要配置 "config-repo": true
|
63
|
+
|
64
|
+
这个仓库称为配置仓库,也叫做**主仓库**,其他仓库叫做**子仓库**
|
65
|
+
|
66
|
+
- 使用 `mgit init -f manifest文件路径` 初始化多仓库,命令测试 manifest.json 配置是否正常
|
67
|
+
|
68
|
+
注意这个命令不会重复拉取主仓库,只会拉取所有的子仓库到当前目录,并在当前目录创建一个.mgit
|
69
|
+
|
70
|
+
你可以在当前目录中看到每个仓库的源码,他们的路径可以通过 manifest.json 的 dest字段配置
|
71
|
+
|
72
|
+
你也可以在 .mgit/source-git/ 下看到所有仓库的.git, 这是 MGit 对所有仓库的托管
|
73
|
+
|
74
|
+
- 本地测试成功后,你可以提交主仓库中的 manifest.json,推送主仓库的变更到远端
|
75
|
+
|
76
|
+
- 通过 `mgit init -g 主仓库地址` 命令初始化多仓库
|
77
|
+
|
78
|
+
|
79
|
+
#### 4、进一步了解 MGit
|
56
80
|
|
57
81
|
[常用命令](docs/use/common-commands.md)
|
58
82
|
|
@@ -60,24 +84,26 @@ $ mgit status 产看仓库分支超前/落后情况
|
|
60
84
|
|
61
85
|
[配置多仓库](docs/config/config-env.md)
|
62
86
|
|
87
|
+
[使用 MGit 管理多仓库的案例](docs/use/how-to-start.md#4-mgit-)
|
88
|
+
|
63
89
|
[了解更多](docs/references.md)
|
64
90
|
|
65
91
|
|
66
92
|
## 测试
|
67
93
|
|
68
94
|
单测在MGit仓库内的test文件夹下
|
69
|
-
新建单测文件,必须以‘test_
|
95
|
+
新建单测文件,必须以‘test_’开头
|
70
96
|
执行单测:rake (如果报错尝试执行 bundle install)
|
71
97
|
|
72
98
|
|
73
99
|
## 如何贡献
|
74
100
|
|
75
|
-
欢迎开发者向MGit贡献代码。如果您开发了新功能或发现了bug,欢迎给我们提交PR。
|
101
|
+
欢迎开发者向 MGit 贡献代码。如果您开发了新功能或发现了 bug,欢迎给我们提交PR。
|
76
102
|
|
77
103
|
代码贡献要求:
|
78
104
|
1. 功能和实现应该具有通用性, 不是为了解决某个具体业务而定制的代码逻辑
|
79
|
-
2. 代码质量高,符合Ruby编码规范
|
80
|
-
3. 需要补充对应的单测case
|
105
|
+
2. 代码质量高,符合 Ruby 编码规范
|
106
|
+
3. 需要补充对应的单测 case
|
81
107
|
|
82
108
|
issues贡献: 如在使用中遇到问题,请在 https://github.com/baidu/m-git/issues 新建 issues 反馈问题。
|
83
109
|
|
data/lib/m-git/command/config.rb
CHANGED
@@ -26,11 +26,11 @@ module MGit
|
|
26
26
|
ARGV::Opt.new(OPT_LIST[:update_manifest],
|
27
27
|
short_key:OPT_LIST[:update_manifest_s],
|
28
28
|
info:"该指令用于更新mgit所使用的配置文件,如:\"mgit config -m <new_path>/manifest.json\"。",
|
29
|
-
type: :
|
29
|
+
type: :string),
|
30
30
|
ARGV::Opt.new(OPT_LIST[:update_local],
|
31
31
|
short_key:OPT_LIST[:update_local_s],
|
32
32
|
info:"该指令用于更新mgit所使用的本地配置文件,如:\"mgit config -u <new_path>/local_manifest.json\"。",
|
33
|
-
type: :
|
33
|
+
type: :string),
|
34
34
|
ARGV::Opt.new(OPT_LIST[:create_local],
|
35
35
|
short_key:OPT_LIST[:create_local_s],
|
36
36
|
info:"在指定目录下创建本地配置文件,若目录不存在则自动创建。如执行:\"mgit config -c /a/b/c\",则生成本地配置文件:\"/a/b/c/local_manifest.json\"。如果未传入值,如:\"mgit config -c\",那么若配置仓库存在的话,会在配置仓库中创建本地配置文件。",
|
data/lib/m-git/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: m-git
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zhangyu81
|
8
8
|
autorequire:
|
9
9
|
bindir: "./"
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colored2
|
@@ -70,16 +70,16 @@ dependencies:
|
|
70
70
|
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 12.3.3
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 12.3.3
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: minitest
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|