Requirements • QuickStart • Overview • Support • License
git-deps-syncer is a lightweight CLI tool used for syncing git repositories as external source dependencies into any working directory.
It offers a simple alternative to git submodule
/ subtree
by allowing a drop-in-replacement of any git repository as an immutable source dependency that is part of the actual working repository source code, files are located and managed within a dedicated external
folder using symlinks.
- A Unix-like operating system: macOS, Linux
git
(recommendedv2.30.0
or higher)jq
(for parsing JSON based config)gh
(Optional: GitHub client for opening PRs upon changes)
The fastest way (for macOS
and Linux
) to install git-deps-syncer
is using Homebrew:
brew install ZachiNachshon/tap/git-deps-syncer
Alternatively, tap into the formula to have brew search capabilities on that tap formulas:
# Tap
brew tap ZachiNachshon/tap
# Install
brew install git-deps-syncer
For additional installation methods read here.
Maintainers / Contributors:
Those are some of the requirements that lead me to implement a custom solution instead of using git submodule
/ subtree
:
- Merge any git repository into a working directory source code, treating it as external source dependency
- Keep the external source dependencies immutable for changes
- Having the external git repositories version controlled
- Treat external git repositories as they were standard libraries imports
- Having the ability to hot-swap git external dependencies easily with local paths for development
git-deps-syncer
is a CLI utility that can be used globally on any directory, though it should mainly be used on a git repository directory. It relies on pre-configured list of git repositories, those are getting fetched and stored within the source code of the working repository within a dedicated unique folder, making them available via symlinks for hot-swap if nessesary.
❗ Note |
---|
Every git repository is being cloned into a shared cache directory outside the working directory and its files and folders are being copied without the git index. |
-
Change directory into a working repository you plan to add the git depdencies
-
Auto generate a
.git-deps/config.json
file by running:git-deps-syncer init
-
Edit the
.git-deps/config.json
file with desired git dependencies -
Sync all git external dependencies into the working directory by running:
git-deps-syncer sync-all
💡 Note Add the flag --open-github-pr
in order to automatically open a PR based on changes introduced by thesync-all
action. -
Run
git-deps-syncer -h
for additional options
Please refer to the documentation for detailed explanation on how to configure and use git-deps-syncer
.
git-deps-syncer
is an open source project that is currently self maintained in addition to my day job, you are welcome to show your appreciation by sending me cups of coffee using the the following link as it is a known fact that it is the fuel that drives software engineering ☕
MIT