Giter Club home page Giter Club logo

mono2repo's Introduction

mono2repo

PyPI version Python versions Build Black Coverage

This module (and related script) extracts the content of a subtree in a monorepo and it creates a stand alone repo (copying the related history).

Let say you have a monorepo with multiple projects (project1, project2 etc.) and we wan to make project1 a stand alone repo (retaining the project1 history):

monorepo/
├── README.TXT
├── misc
│   └── more
└── subfolder
    ├── project1           # <-- we want to extract this
    │   └── a
    │       ├── hello.txt
    │       └── subtree
    ├── project2
    └── project3

The command to to this is:

mono2repo init -v project1 monorepo/subfolder/project1

Installation

You can install mono2repo via pip from PyPI:

$ pip install mono2repo

The mono2repo.py is a standalone script and it can be just dowloaded:

curl -LO https://raw.githubusercontent.com/cav71/mono2repo/master/mono2repo.py

Example

For this example we first create the summary repo from the main pelican monorepo, then we update the summary with the new upstream changes:

https://github.com/getpelican/pelican-plugins.git
....
└ summary/
 ├── Readme.rst
 └── summary.py

Create a new repo

First we create a new repo:

mono2repo init summary-extracted \
    https://github.com/getpelican/pelican-plugins.git/summary

Note

summary-extracted has two branches master and the migrate (leave this alone!). It is not time to merge the changes into master:

> cd summary-extracted
> git checkout master
> git merge migrate

Update the repo

Update the summary-extracted with the latest summary related changes:

mono2repo update summary-extracted

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.