• Stars
    star
    166
  • Rank 220,927 (Top 5 %)
  • Language
    Ruby
  • License
    MIT License
  • Created about 3 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

MGit 是一款基于 Git 的多仓库管理工具,可以安全的、高效的管理多个 Git 仓库; 适合于在多个仓库中进行关联开发的项目,实现批量的版本管理功能,提高 Git 操作的效率,避免逐个执行 Git 命令带来的误操作风险。

MGit

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

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

  • 直观高效的执行命令 提供图表化的结果展示,开发者可以快速查看命令在多个仓库的执行结果; 多线程并发执行多仓库命令,通过仓库缓存机制提高仓库的拉取效率;

  • 安全的执行命令 在执行命令前对多仓库状态进行安全检查:分支是否异常,工作区是否未提交代码等; 对 .git 进行托管与 Git 工作区分类,避免误删丢失改动或提交; 执行存在风险的操作时,会给与风险操作提示,避免误操作;

  • 方便扩展 支持加载 ruby-gem 包作为插件,gem 包名格式 m-git-${suffix}mgit-${suffix} 快速的扩展 MGit 的命令,增加自定义命令,扩展已有命令的功能; 提供类似git hook的 hook 点,方便开发者实现自定义逻辑;

快速开始

1、安装 MGit 工具

环境要求:

  • 系统:支持 macOS、Ubuntu,暂时不支持 Windows
  • Ruby版本: >= 2.3.7
$ gem install m-git

2、初始化多仓库

初始化多仓库使用 mgit init 命令;

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

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

# 2.1 建议在一个新文件夹中拉取demo
$ mgit init -g https://github.com/baidu/m-git.git

# 2.2 体验一下mgit命令
$ mgit -l                 显示所有mgit管理的仓库
$ mgit branch --compact   查看多仓库的分支
$ mgit status             产看仓库分支超前/落后情况

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

  • 根据文档配置 manifest.json

    将要管理的仓库都配置到 manifest.json 中

  • 将 manifest.json 放到一个仓库中管理

    这个仓库同样会在 manifest.json 中描述,并且需要配置 "config-repo": true

    这个仓库称为配置仓库,也叫做主仓库,其他仓库叫做子仓库

  • 使用 mgit init -f manifest文件路径 初始化多仓库,命令测试 manifest.json 配置是否正常

    注意这个命令不会重复拉取主仓库,只会拉取所有的子仓库到当前目录,并在当前目录创建一个.mgit

    你可以在当前目录中看到每个仓库的源码,他们的路径可以通过 manifest.json 的 dest字段配置

    你也可以在 .mgit/source-git/ 下看到所有仓库的.git, 这是 MGit 对所有仓库的托管

  • 本地测试成功后,你可以提交主仓库中的 manifest.json,推送主仓库的变更到远端

  • 通过 mgit init -g 主仓库地址 命令初始化多仓库

4、进一步了解 MGit

常用命令

manifest文件介绍

配置多仓库

使用 MGit 管理多仓库的案例

了解更多

测试

单测在MGit仓库内的test文件夹下 新建单测文件,必须以‘test_’开头 执行单测:rake (如果报错尝试执行 bundle install)

如何贡献

欢迎开发者向 MGit 贡献代码。如果您开发了新功能或发现了 bug,欢迎给我们提交PR。

代码贡献要求:

  1. 功能和实现应该具有通用性, 不是为了解决某个具体业务而定制的代码逻辑
  2. 代码质量高,符合 Ruby 编码规范
  3. 需要补充对应的单测 case

issues贡献: 如在使用中遇到问题,请在 https://github.com/baidu/m-git/issues 新建 issues 反馈问题。

More Repositories

1

amis

前端低代码框架,通过 JSON 配置就能生成各种页面。
TypeScript
16,239
star
2

uid-generator

UniqueID generator
Java
5,329
star
3

san

A fast, portable, flexible JavaScript component framework
JavaScript
4,707
star
4

lac

百度NLP:分词,词性标注,命名实体识别,词重要性
C++
3,758
star
5

braft

An industrial-grade C++ implementation of RAFT consensus algorithm based on brpc, widely used inside Baidu to build highly-available distributed systems.
C++
3,499
star
6

dperf

dperf is a DPDK based 100Gbps network performance and load testing software.
C
3,273
star
7

bfs

The Baidu File System.
C++
2,845
star
8

openrasp

🔥Open source RASP solution
C++
2,705
star
9

Familia

A Toolkit for Industrial Topic Modeling
C++
2,632
star
10

AnyQ

FAQ-based Question Answering System
C++
2,566
star
11

sofa-pbrpc

A light-weight RPC implement of google protobuf RPC framework.
C++
2,121
star
12

tera

An Internet-Scale Database.
C++
1,880
star
13

Senta

Baidu's open-source Sentiment Analysis System.
Python
1,819
star
14

bfe-book

In-depth Understanding of BFE《深入理解BFE》(Book for BFE, a CNCF open source project. both in English and in Chinese)
1,212
star
15

bigflow

Baidu Bigflow is an interface that allows for writing distributed computing programs and provides lots of simple, flexible, powerful APIs. Using Bigflow, you can easily handle data of any scale. Bigflow processes 4P+ data inside Baidu and runs about 10k jobs every day.
C++
1,141
star
16

BaikalDB

BaikalDB, A Distributed HTAP Database.
C++
1,132
star
17

DuReader

Baseline Systems of DuReader Dataset
Python
1,108
star
18

DDParser

百度开源的依存句法分析系统
Python
955
star
19

starlight

Java implementation for Baidu RPC, multi-protocol & high performance RPC.
Java
945
star
20

CUP

CUP, common useful python-lib. (Currently, Most popular python lib in baidu). Python 开发底层库, 涵盖util、service(threadpool/generator/executor/cache等等)、logging、monitoring、增强型配置 等等库支持
Python
934
star
21

ICE-BA

C++
700
star
22

NoahV

An efficient front-end application framework based on vue.js
JavaScript
638
star
23

EasyFaaS

EasyFaaS是一个依赖轻、适配性强、资源占用少、无状态且高性能的函数计算服务引擎
Go
617
star
24

Jprotobuf-rpc-socket

Protobuf RPC是一种基于TCP协议的二进制RPC通信协议的Java实现
Java
516
star
25

bifromq

A MQTT broker implementation adopting serverless architecture
Java
514
star
26

Curve

An Integrated Experimental Platform for time series data anomaly detection.
JavaScript
514
star
27

fast_rgf

Multi-core implementation of Regularized Greedy Forest
C++
466
star
28

Dialogue

Python
444
star
29

Elasticsearch

Baidu Elasticsearch
Java
432
star
30

brcc

BRCC(better remote config center)是一个分布式配置中心,用于统一管理应用服务的配置信息,避免各类资源散落在各个项目中,简化资源配置的维护成本。作为一种轻量级的解决方案,部署简单,同时支持多环境、多版本、多角色的资源管理,可以在不改变应用源码的情况下无缝切换和实时生效配置信息。
Java
383
star
31

Cafe

A powerful test framework for Android
Java
370
star
32

mix-img

A fast mix image javascript tool libary
JavaScript
332
star
33

unit-dmkit

C++
328
star
34

galaxy

Galaxy is a cluster management system.
C++
326
star
35

information-extraction

Python
325
star
36

puck

Puck is a high-performance ANN search engine
Jupyter Notebook
304
star
37

knowledge-driven-dialogue

baseline system of knowledge driven dialogue competition
Python
271
star
38

CarbonGraph

A Swift dependency injection / lookup framework for iOS
Swift
252
star
39

unit-uskit

unit-uskit
C++
251
star
40

BIPlatform

JavaScript
219
star
41

dlock

An effective and reliable Distributed Lock
Java
216
star
42

ins

iNexus, coordinate large scale services
C++
213
star
43

boteye

C++
212
star
44

titan-dex

Java
201
star
45

Rubik

An Android platform component management tool chain, based on Kotlin language.
Kotlin
154
star
46

common

Common library
C++
132
star
47

go-lib

Go
126
star
48

titan-hotfix

Java
125
star
49

wx2

小程序互转工具
JavaScript
124
star
50

iot-sdk-c

device sdk for baidu IoT Core service, in c. Including MQTT client
C
118
star
51

Youtube-8M

PaddlePaddle models for Youtube-8M Video Understanding Challenge
Python
114
star
52

ar-sdk

DuMix AR SDK for Developer
GLSL
105
star
53

broc

Python
101
star
54

ITEST

Web service interface test framework
97
star
55

ote-stack

OTE-Stack is an edge computing platform for 5G and AI
Go
96
star
56

GPT

Java
87
star
57

redis

Baidu Ksarch Redis - a production solution of redis cluster
87
star
58

san-devtools

Browser developer tools extension for debugging San.
TypeScript
82
star
59

terminator

Service Virtualization
Java
76
star
60

QCompute

QCompute is a Python-based quantum software development kit (SDK). It provides a full-stack programming experience for advanced users via hybrid quantum programming language features and a high-performance simulator.
Python
76
star
61

spring-cloud-baidu

69
star
62

iot-edge-sdk-for-iot-parser

C
64
star
63

shuttle

A fast computing framework based on Galaxy
C++
64
star
64

baidu-iot-samples

C
61
star
65

san-store

Application States Management for San
JavaScript
59
star
66

ARK

Development framework of intelligent operation
Python
57
star
67

san-update

Object immutable update utility for san solution
JavaScript
56
star
68

logcover

轻量级异常日志测试覆盖率度量工具
Python
56
star
69

palo

A fast MPP database for all modern analytics on big data. Powered by Apache Doris(Incubating)
50
star
70

speech-samples

百度语音示例
Java
48
star
71

ntripcaster

C
42
star
72

san-router

Official Router for San
JavaScript
38
star
73

Quanlse

Jupyter Notebook
38
star
74

san-ssr

San SSR framework and utils
TypeScript
37
star
75

dm-kit-php

PHP
36
star
76

boteye_sensor

C
35
star
77

ipipe-agent

Java
33
star
78

OASP

OASP (Online App Status Protocol)
Java
32
star
79

san-composition

JavaScript
30
star
80

duedge-recipes

DuEdge百度边缘网络计算样例代码
JavaScript
27
star
81

paddle-on-k8s-operator

Kubernetes operator for managing the lifecycle of PaddlePaddle job.
Go
24
star
82

baiducloud-sdk-go

Go SDK for Baidu Cloud
Go
23
star
83

san-website

JavaScript
21
star
84

du1906_esp

DUHOME AIOT platform based on du1906 and esp32
C
18
star
85

highflip

HIGHFLIP: An easy way to bridge different federal learning platforms
18
star
86

baiduads-sdk

Baidu Ads API SDK
Python
16
star
87

smartapp-openapi-java

百度智能小程序服务端 OpenAPI SDK for java,是基于小程序服务端 OpenAPI 封装的一套让开发者方便使用的 SDK, 它可以帮开发者减少理解和使用 OpenAPI 的成本, 减少开发者直接调用服务端接口不当而引起的错误, 避免在开发中走弯路。
Java
16
star
88

san-factory

JavaScript
15
star
89

ttm

C
14
star
90

cluster-api-provider-baiducloud

Kubernetes cluster-api for Baidu Cloud
Go
12
star
91

minions

Baidu 100G Chasiss Switch hardware spec
11
star
92

signet

签章系统
JavaScript
10
star
93

sgxray

SGXRay: a bounded verifier for Intel SGX enclaves
C
10
star
94

grafana-tsdb-datasource

JavaScript
9
star
95

iotcore-sdk-java

Java SDK for baidu IoT Core service
Java
8
star
96

iot

for all code about Internet of Things
8
star
97

smartapp-openapi-go

百度智能小程序服务端 OpenAPI SDK for go,是基于小程序服务端 OpenAPI 封装的一套让开发者方便使用的 SDK, 它可以帮开发者减少理解和使用 OpenAPI 的成本, 减少开发者直接调用服务端接口不当而引起的错误, 避免在开发中走弯路。
Go
8
star
98

bce-fpga-dev-kit

VHDL
6
star
99

duedge-cli

DuEdge Command Line
Python
6
star
100

brcc-go-sdk

golang sdk for BRCC (https://github.com/baidu/brcc)
Go
6
star