Skip to content

Turning a module into a repository

Alexander Yevsyukov edited this page Aug 20, 2024 · 1 revision

Sometimes when a project goes bigger it is practical to extract a module into a separate repository. This page is a guide for this process. It assumes you have filter-repo command for git installed.

Basic instructions

The process is described by this GitHub article.

Here are a couple of adjustments.

Cloning the repository

It is more convenient to clone a copy of existing repo into a new directory, having the dot at the end of the command:

git clone https://github.com/USERNAME/REPOSITORY-NAME .

This way you wouldn't have a nested directory with the repo code under the current one.

Setting remote origin

Instead of this command

git remote set-url origin https://github.com/USERNAME/NEW-REPOSITORY-NAME.git

you may need to run the following command

git remote add origin https://github.com/USERNAME/NEW-REPOSITORY-NAME.git

Chances are that you wouldn't have an origin at all to set its URL. So we add instead.

Add config as a Git submodule

git submodule add https://github.com/SpineEventEngine/config.git

Then:

./config/pull

Overcoming 422 Unprocessable Entity issue

GitHub cannot publish an artifact with the same ID into another repository. Before you start publishing artifacts from the new repository, please make sure you deleted older published versions from GitHub Packages.

Linking Codecov to the new repository

Please make sure that new repository is added to Codecov.

Update README.md

  • Please describe the purpose of this repository.
  • Add appropriate badges for the CI status, the license, and Codecov.
  • Please also provide usage instructions for adding the artifact(s) of the new repository to a Gradle project.

Clone this wiki locally