Select Page

Stitching several git repositories into a git fast-import stream

Stitching several git repositories into a git fast-import stream

git-stitch-repo

Stitch several git repositories (merging git repository) into a git fast-import stream from Git-FastExport

Installation

$ perl -MCPAN -e shell    cpan[6]> i /fastexport/ 	Distribution    BOOK/Git-FastExport-0.107.tar.gz 	Module  < Git::FastExport        (BOOK/Git-FastExport-0.107.tar.gz) 	Module  < Git::FastExport::Block (BOOK/Git-FastExport-0.107.tar.gz) 	Module  < Git::FastExport::Stitch (BOOK/Git-FastExport-0.107.tar.gz) 	4 items found  cpan[6]> install BOOK/Git-FastExport-0.107.tar.gz  cpan[6]> CTRL-D

Usage

git-stitch-repo will process the output of git fast-export –all –date-order on the git repositories given on the command-line, and create a stream suitable for git fast-import that will create a new repository containing all the commits in a new commit tree that respects the history of all the source repositories. Typical usage is like this:

 git clone https://github.com/xxxx/A.git git clone https://github.com/xxxxx/B.git  $ ls A B  mkdir result cd result git init git-stitch-repo ../A:folderA ../B:folderB | git fast-import  # pull both repository in a new branch for examples git checkout -b newBranch git pull . master-A git pull . master-B  # when finished delete unused branches git branch -d master-A  git branch -d master-B

About The Author

I worked with various Insurances companies across Switzerland on online applications handling billion premium volumes. I love to continuously spark my creativity in many different and challenging open-source projects fueled by my great passion for innovation and blockchain technology.In my technical role as a senior software engineer and Blockchain consultant, I help to define and implement innovative solutions in the scope of both blockchain and traditional products, solutions, and services. I can support the full spectrum of software development activities, starting from analyzing ideas and business cases and up to the production deployment of the solutions.I'm the Founder and CEO of Disruptr GmbH.

Categories