remote_hooks 1.0.0 copy "remote_hooks: ^1.0.0" to clipboard
remote_hooks: ^1.0.0 copied to clipboard

A CLI tool to share & install git hooks from remote repository

pub package

Getting Started #

Add remote_hooks to your project's dev_dependencies:

dart pub add dev:remote_hooks
copied to clipboard

Then, interact with it inside your project using:

dart run remote_hooks -h
copied to clipboard

Alternatively, install it globally:

dart pub global activate remote_hooks
copied to clipboard

Once installed globally, you can use it anywhere:

remote_hooks -h
copied to clipboard

Features #

Store Git hooks in a shared repository to ensure consistency and reusability across team members and multiple projects.

Usage #

Hooks installation #

Usage: remote_hooks install [arguments]
-h, --help    Print this usage information.
-u, --url     Url to the remote repository
-r, --ref     Repository ref to checkout
copied to clipboard

For example you can this command to install hooks from remote repository

remote_hooks install -u git@github.com:SilentCatD/where-you-store-hooks.git
copied to clipboard

Specify ref to switch branch or checkout a specific commit, this help with different hooks for different projects

Hooks uninstall hooks #

To uninstall, use:

remote_hooks uninstall
copied to clipboard

Configuration #

You can also store the information about url and ref in a config file. At the root of your repository, create a remotehooks.yaml file, inside you can specify these 2 keys:

git-url: git@github.com:SilentCatD/where-you-store-hooks.git
ref: develop
copied to clipboard

Hooks repository structure (Remote repository) #

Contents of the remote hooks repository will be copied to .git/hooks, in the remote repository, you can add a .hooksignore to exclude files and folders from being copied.

Patterns defined inside .hooksignore and .gitignore will be merged together to create a final exclusive list of patterns.

File extension of files at the root level is not important, as they will be omitted when copying

Example of a repository structure for pre-commit and pre-push with hooks written in python

├── .gitignore
├── .hooksignore
├── hooks_utils
│ ├── formatter_utils.py
│ └── printer_utils.py
├── pre-commit.py
└── pre-push.py
copied to clipboard

Additional information #

For additional command details, use remote_hooks -h

remote_hooks <command> -h
copied to clipboard
2
likes
0
points
60
downloads

Publisher

verified publishersilentcat.dev

Weekly Downloads

2024.09.26 - 2025.04.10

A CLI tool to share & install git hooks from remote repository

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

args, cli_util, io, meta, path, uuid, yaml

More

Packages that depend on remote_hooks