Skip to main content
Check
Git Deps Syncer

Sync git repositories as  source dependencies

Add any remote git repository as an immutable and versioned external source dependency to your working repository with optional filters to control what should be synced.

brew install ZachiNachshon/tap/git-deps-syncer
Read the docs

Currently v0.8.0 · Download · Docs · All Releases

Easily add and update sources from remote git repositories

Fetch sources from remote git repositories, treat them as 3rd party dependencies, controlled by git-deps-syncer.

Read installation docs

Install using several options

Install git-deps-syncer via Homebrew, pre-built release or from sources. Package managed installs contains only the bare minimum without documentation / site / dev-scripts etc...

For additional information check the download section.

Syncing a remote git dependency

Syncing a new git dependency into a working repository is as simple as running the following command:

git-deps-syncer sync shell_scripts_lib

For additional information check the configuration section.

Define git repository as a 3rd party dependency

git-deps-syncer uses a configuration file to keep track of existing git dependencies and manage their versioned sources.

Learn more about configuration options

Declare git dependencies in a config.json file

Update the .git-deps/config.json file with git dependencies to sync their source code as 3rd parties. Those repositories .git index folder is excluded from sync.


{
  "dependencies": {
    "repos": [
      {
        "name": "shell_scripts_lib",
        "url": "https://github.com/Organization/shell-scripts-lib.git",
        "branch": "master",
        "revision": "ab12cd...",
      },
      {
        "name": "python_scripts_lib",
        "url": "https://github.com/Organization/python-scripts-lib.git",
        "branch": "master",
        "revision": "cd21ab...",
      }
    ]
  }
}

Understanding the dependencies layout

Dependencies sources are saved into .git-deps/external folder, references to those files are via symlinks from the external folder.

├── ...
├── .git-deps                   
│   ├── external               
│   │   ├── shell_scripts_lib  (sources)
│   │   ├── python_scripts_lib (sources)
│   │   └── ...       
│   └── config.json                
├── ...
├── <additional-files-and-folders>
├── ...
├── external              
│   ├── shell_scripts_lib  (symlink) 
│   └── python_scripts_lib (symlink)
├── ...
├── <additional-files-and-folders>
└── ...

Learn more about how to use external folder symlinks.

Use git-deps-syncer special features

Explore git-deps-syncer special features that simpify the git dependencies initial setup and management.

Learn more about available features

Simple integration

Use the init action to create an empty .git-deps folder within the project content root containing a config.json generated from an example template.

git-deps-syncer init

Development mode

Hot swap a synced dependency to a locally hosted one to verify special cases, hot-fixes and such, mainly used for local development.

git-deps-syncer sync shell_scripts_lib --save-dev

{
  "dependencies": {
    "repos": [ ... ],
  },
  "devDependencies": {
    "repos": [
      {
        "name": "shell_scripts_lib",
        "localPath": "/local/path/to/shell-scripts-lib"
      }
    ]
  }
}

GitHub interactions

Allow opening a GitHub PR upon sync or sync-all actions if there are staged changes.

git-deps-syncer sync shell_scripts_lib --open-github-pr

Explore usages

Go over a list of repositories that are using git-deps-syncer.

Click to head over to the list