OSS Porter is a command-line tool for open-sourcing a project that lives inside a private Git repository. It extracts the project into its own public repository and then keeps that repository in sync as the internal code changes. The binary is oss-porter.
Moving code from an internal monorepo to a public one is easy to get wrong: history can carry secrets, path dependencies can point at code that is not being published and later changes have to be carried over by hand. OSS Porter handles the mechanics and leaves the judgment to you, with a manual review step built into each stage.
Projects are defined in ~/.oss-porter.toml, one entry per project with its internal repository path, subdirectory and output path. oss-porter config init creates the file and config add sets up a project interactively. extract copies the project out in one of two modes: clean_slate, the default, starts with no history, while preserve tries to keep the project's history using git-filter-repo. After you review and clean the output, check looks for path dependencies and license files and push sends the result to the public remote.
For later changes, update walks through the new internal commits one at a time and asks you about each. It records what has been synced in a .oss_porter_state.toml file committed inside the internal repository, so the next update knows where to start. Conflicts are resolved by hand in the output directory before running update again.
It needs Git, plus git-filter-repo for the preserve mode. Licensed under MPL-2.0. Source at https://github.com/normano/oss_porter.
