embd is a CLI tool that serves as an alternative to git subtree and git submodule. It's heavily inspired by beman-submodule.
See the design documentation for more details on some of the differences between embd and beman-submodule as well as why those decisions were made.
Install the latest published release from crates.io:
cargo install embd-cliTo build and install from a local checkout instead, use just or cargo:
# with just
just install
# or with cargo
cargo install --path .embd add -l <repo link>.git -f <local folder>This will clone the repository to the given folder and create a config.toml and embd.lock file in the .embd folder. These files should be commited to VCS. You can also filter the contents of the repository using -i and -e flags. These use glob filters to include or exclude certain folders or files. For example, to exclude all Markdown and include all text files, you could the following:
embd add -l <repo> -f <folder> -i "**.txt" -e "**.md"To update all embedded projects, run:
embd updateTo update a specific project, use the name of the repo. This corresponds to the key of the projects entry in the .embd/config.toml file:
embd update infraTo update a project to a new commit, tag or branch, use the -r or --rev flag:
embd update infra --rev abcd1234This will update the files on disk and update the commit hash tracked in the config file and lock file. In addition, the entries in the lock file for the given project will also be updated. Updates can also be forced using --force and untracked files can be removed using --overwrite. See embd update -h for more details.
To check for deviations, run:
embd statusThis will print out any files that differ from the tracked revision of the pulled files. This is mostly useful for ensuring that files that are part of an "embed" are not inadvertently edited. This check can be used in CI workflows to ensure that such edits do not occur.
Credit to the Beman Project and the beman-submodule tool for the inspiration and initial idea for a tool like this.
@ptsouchlos |
|---|