Coder Social home page Coder Social logo

mgitrepo's Introduction

Multi Git Repo

A Git command line to manage multiple git repositories at once.

Use case

If you work in a microservices environment, with multiple repositories (mnulti repo), you have to work on several projects. Switching from one branch to another, managing them or keeping them updated can be tedious and with a high probability of forgetfulnesses

This module aims to replace this :

$ cd apps/project1
$ git pull
$ cd apps/project2
$ git pull
$ cd apps/project3
$ git pull
$ cd lib/project4
$ git pull
$ cd lib/project5
$ git pull
...

by that :

$ mgit pull

the same goes for fetch, branch, checkout, etc...

Install

Globally

$ npm install -g mgitrepo

Locally

$ npm install mgitrepo

How to use locally

$ ./node_modules/.bin/mgit [command]

or if you add in your script section in package.json

...
"scripts": {
  ...
  "mgit": "mgit",
  ...
},
...
$ npm run mgit [command]

Configuration

mgit will try to read its configuration file in project root directory.

This file must be named .mgit.json and be in json format.

[
  {
    "url": "https://github.com/path/main-project.git",
    "name": "main-project",
    "path": "./"
  },
  {
    "url": "https://github.com/path/project1.git",
    "name": "project1",
    "path": "./apps/project1"
  },
  {
    "url": "https://github.com/path/project2.git",
    "name": "project2",
    "path": "./apps/project2"
  },
  {
    "url": "https://github.com/path/project3.git",
    "name": "project3",
    "path": "./apps/project3"
  },
  {
    "url": "https://github.com/path/project4.git",
    "name": "project4",
    "path": "./lib/project4"
  },
  {
    "url": "https://github.com/path/project5.git",
    "name": "project5",
    "path": "./lib/project5"
  }
]
  • url: the repository URL
  • name: the name by which you want to identify the project
  • path: the path where you want to clone the repository or the path where it is located

Available commands

Init cloning

mgit clone

Clone all repositories to their relative paths

All git commands

mgit [git command]

For example:

mgit status
mgit branch
mgit checkout -b newbranch
mgit checkout otherbranch
mgit add .
mgit commit -m "New feature"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.