https://github.com/yonis-savary/git-watch
Bash script to automatically pull changes and (re)build your app
https://github.com/yonis-savary/git-watch
automation bash cicd
Last synced: about 2 months ago
JSON representation
Bash script to automatically pull changes and (re)build your app
- Host: GitHub
- URL: https://github.com/yonis-savary/git-watch
- Owner: yonis-savary
- License: mit
- Created: 2025-07-18T12:31:48.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-07-22T07:41:19.000Z (11 months ago)
- Last Synced: 2025-07-30T13:08:41.240Z (11 months ago)
- Topics: automation, bash, cicd
- Language: Shell
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# git-watch
Bash script to automatically pull changes and (re)build your app every X seconds
## Requirements
- git
- bash (present on most popular linux distros)
# Installation
```sh
mkdir /opt
cd /opt
git clone git@github.com:yonis-savary/git-watch.git # OR https://github.com/yonis-savary/git-watch.git
sudo ln -s /opt/git-watch/git-watch /usr/local/bin/git-watch
# Or add /opt/git-watch in your $PATH
```
## How does it work
The script initialy start a "runner" version of itself, which contains the actual code
When the runner works:
- Fetch for changes on `--branch`
- If any :
- Execute `--command`
- Sleep `--sleep` seconds (10 minutes by default)
Here is two simple examples
```sh
git-watch --output ./watch.logs --command "npm ci"
git-watch --main feature-branch --sleep 600 --command "npm ci"
```
Additionnally, you can specify:
- a log file with `--output`,
- a repository path with `--path` (current directory by default),
- runner process name with `--name` (It is advised that you let git-watch decide itself)
You can also run the process directly with `git-watch run `
You can list your runner instances with
```sh
git-watch ps
```
If you want to stop your runner instance, simply use
```sh
git-watch stop
```