All Projects → splitsh → Lite

splitsh / Lite

Licence: mit
Split a repository to read-only standalone repositories

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Lite

monorepo-split-github-action
Github Action for Monorepo Split
Stars: ✭ 56 (-95.44%)
Mutual labels:  split, monorepo
Purser
Interact with Ethereum wallets easily
Stars: ✭ 76 (-93.82%)
Mutual labels:  monorepo
React Native Spaceviewer
See and search upcoming and previous rocket space launches! Built with React Native, using Detox E2E tests, Fastlane and Github Actions for app store deployment.
Stars: ✭ 61 (-95.04%)
Mutual labels:  monorepo
Vitamin Web
Decathlon Design System libraries for web applications
Stars: ✭ 70 (-94.3%)
Mutual labels:  monorepo
Metav
Release and Versioning of Clojure projects using tools.deps
Stars: ✭ 62 (-94.96%)
Mutual labels:  monorepo
Superset Ui Plugins
A collection of official Superset UI plugins
Stars: ✭ 73 (-94.06%)
Mutual labels:  monorepo
Outlookgooglecalendarsync
Sync your Outlook and Google calendars
Stars: ✭ 1,113 (-9.44%)
Mutual labels:  synchronization
Splitting
JavaScript microlibrary to split an element by words, characters, children and more, populated with CSS variables!
Stars: ✭ 1,222 (-0.57%)
Mutual labels:  split
Create React App
Yarn Workspaces Monorepo support for Create-React-App / React-Scripts.
Stars: ✭ 76 (-93.82%)
Mutual labels:  monorepo
Sync
Synchronization primitives for PHP based on Amp.
Stars: ✭ 67 (-94.55%)
Mutual labels:  synchronization
Buildpipe Buildkite Plugin
Dynamically generate Buildkite pipelines based on project changes
Stars: ✭ 67 (-94.55%)
Mutual labels:  monorepo
Zaloha.sh
Small and simple directory synchronizer (a BASH script)
Stars: ✭ 63 (-94.87%)
Mutual labels:  synchronization
Bind Query Params
Sync URL Query Params with Angular Form Controls
Stars: ✭ 73 (-94.06%)
Mutual labels:  synchronization
Ciruela
A peer-to-peer synchronization software for servers in datacenters.
Stars: ✭ 61 (-95.04%)
Mutual labels:  synchronization
Chan
Pure C implementation of Go channels.
Stars: ✭ 1,208 (-1.71%)
Mutual labels:  synchronization
React Micro Frontends
This is a monorepo ReactJS based in micro frontends
Stars: ✭ 61 (-95.04%)
Mutual labels:  monorepo
Syncchanges
Synchronize/Replicate database changes using SQL Server Change Tracking
Stars: ✭ 66 (-94.63%)
Mutual labels:  synchronization
Unity Plane Mesh Splitter
Unity Plane Mesh Splitter
Stars: ✭ 71 (-94.22%)
Mutual labels:  split
Cra Monorepo Examples
Monorepo w/ shared components.
Stars: ✭ 80 (-93.49%)
Mutual labels:  monorepo
Generator Django Rest
Yeoman generator for a Django REST/GraphQL API, an optional React SPA & lots more!
Stars: ✭ 77 (-93.73%)
Mutual labels:  monorepo

Git Subtree Splitter

splitsh-lite replaces the subtree split Git built-in command to make splitting a monolithic repository to read-only standalone repositories easy and fast.

Why do I need this tool?

When starting a project, do you store all the code in one repository? Or are you creating many standalone repositories?

Both strategies work well and both have drawbacks as well. splitsh helps use both strategies by providing tools that automatically synchronize a monolithic repository to standalone repositories in real-time.

splitsh-lite is a sub-project that provides a faster implementation of the git subtree split command, which helps create standalone repositories for one or more sub-directories of a main repository.

If you want to learn more about monorepo vs manyrepos, watch this 4-minute lightning talk I gave at dotScale (or read the slides)... or watch the longer version from DrupalCon. "The Monorepo - Storing your source code has never been so much fun" is also a great resource.

Note If you currently have multiple repositories that you want to merge into a monorepo, use the tomono tool.

Installation

The fastest way to get started is to download a binary for your platform and unarchive it with:

sudo tar -zxpf lite_linux_amd64.tar.gz --directory /usr/local/bin/

You can also install it manually.

If you want to integrate splitsh with Git, install it like this (and use it via git splitsh):

cp splitsh-lite "$(git --exec-path)"/git-splitsh

Usage

Let's say you want to split the lib/ directory of a repository to its own branch; from the "master" Git repository (bare or clone), run:

splitsh-lite --prefix=lib/

The sha1 of the split is displayed at the end of the execution:

SHA1=`splitsh-lite --prefix=lib/`

The sha1 can be used to create a branch or to push the commits to a new repository.

Automatically create a branch for the split by passing a branch name via the --target option:

splitsh-lite --prefix=lib/ --target=heads/branch-name

If new commits are made to the repository, update the split by running the same command again. Updates are much faster as splitsh-lite keeps a cache of already split commits. Caching is possible as splitsh-lite guarantees that two splits of the same code always results in the same history and the same sha1s for each commit.

By default, splitsh-lite splits the currently checked out branch but you can split a different branch by passing it explicitly via the --origin flag (mandatory when splitting a bare repository):

splitsh-lite --prefix=lib/ --origin=origin/master

You don't even need to run the command from the Git repository directory if you pass the --path option:

splitsh-lite --prefix=lib/ --origin=origin/1.0 --path=/path/to/repo

Available options:

  • --prefix is the prefix of the directory to split; you can put the split contents in a sub-directory of the target repository by using the --prefix=from:to syntax; split several directories by passing multiple --prefix flags;

  • --path is the path of the repository to split (current directory by default);

  • --origin is the Git reference for the origin (can be any Git reference like HEAD, heads/xxx, tags/xxx, origin/xxx, or any refs/xxx);

  • --target creates a reference for the tip of the split (can be any Git reference like heads/xxx, tags/xxx, origin/xxx, or any refs/xxx);

  • --progress displays a progress bar;

  • --quiet suppresses all output on stderr (useful when run from an automated script);

  • --scratch flushes the cache (useful when a branch is force pushed or in case of a cache corruption).

Migrating from git subtree split

Migrating from git subtree split to splith-lite is easy as both tools generate the same sha1s.

However, note that older versions of git subtree split used broken algorithms, and so generated different sha1s than the latest version. You can simulate those version via the --git flag. Use <1.8.2 or <2.8.0 depending on which version of git subtree split you want to simulate.

Manual Installation

If you want to contribute to splitsh-lite or use it as a library, you first need to install libgit2:

go get -d github.com/libgit2/git2go
cd $GOPATH/src/github.com/libgit2/git2go
git checkout next
git submodule update --init
make install

Then, compile splitsh-lite:

go get github.com/splitsh/lite
go build -o splitsh-lite github.com/splitsh/lite

If everything goes fine, a splitsh-lite binary should be available in the current directory.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].