{"id":13453815,"url":"https://github.com/gitwatch/gitwatch","last_synced_at":"2026-01-25T17:06:28.408Z","repository":{"id":5141562,"uuid":"6308345","full_name":"gitwatch/gitwatch","owner":"gitwatch","description":"Watch a file or folder and automatically commit changes to a git repo easily.","archived":false,"fork":false,"pushed_at":"2025-12-07T16:07:18.000Z","size":183,"stargazers_count":1649,"open_issues_count":3,"forks_count":222,"subscribers_count":42,"default_branch":"master","last_synced_at":"2025-12-10T02:58:30.128Z","etag":null,"topics":["autocommit","git"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"ovirt-china/manage-domains-plugin","license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gitwatch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2012-10-20T11:31:38.000Z","updated_at":"2025-12-07T16:07:22.000Z","dependencies_parsed_at":"2024-03-13T23:23:51.237Z","dependency_job_id":"661f3e20-c51d-4b76-aeb0-9a4515f2e3ee","html_url":"https://github.com/gitwatch/gitwatch","commit_stats":{"total_commits":199,"total_committers":34,"mean_commits":5.852941176470588,"dds":0.7939698492462312,"last_synced_commit":"29fc305f021e3107ff99e6a25ac585d7a2866f42"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/gitwatch/gitwatch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitwatch%2Fgitwatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitwatch%2Fgitwatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitwatch%2Fgitwatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitwatch%2Fgitwatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gitwatch","download_url":"https://codeload.github.com/gitwatch/gitwatch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitwatch%2Fgitwatch/sbom","scorecard":{"id":428500,"data":{"date":"2025-08-11","repo":{"name":"github.com/gitwatch/gitwatch","commit":"fc383f29b302a79fc6b24a941bcde83642665057"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.1,"checks":[{"name":"Code-Review","score":3,"reason":"Found 10/29 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":4,"reason":"5 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/gitwatch.yml:1","Warn: no topLevel permission defined: .github/workflows/pre-commit.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/gitwatch.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/gitwatch/gitwatch/gitwatch.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/gitwatch.yml:63: update your workflow using https://app.stepsecurity.io/secureworkflow/gitwatch/gitwatch/gitwatch.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/gitwatch.yml:83: update your workflow using https://app.stepsecurity.io/secureworkflow/gitwatch/gitwatch/gitwatch.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pre-commit.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/gitwatch/gitwatch/pre-commit.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pre-commit.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/gitwatch/gitwatch/pre-commit.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pre-commit.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/gitwatch/gitwatch/pre-commit.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pre-commit.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/gitwatch/gitwatch/pre-commit.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pre-commit.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/gitwatch/gitwatch/pre-commit.yml/master?enable=pin","Warn: containerImage not pinned by hash: Dockerfile:1: pin your Docker image by updating alpine:3.1 to alpine:3.1@sha256:4dfc68bc95af5c1beb5e307133ce91546874dcd0d880736b25ddbe6f483c65b4","Warn: npmCommand not pinned by hash: .github/workflows/gitwatch.yml:66","Warn: pipCommand not pinned by hash: .github/workflows/pre-commit.yml:22","Info:   0 out of   8 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 containerImage dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned","Info:   0 out of   1 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 11 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T02:47:25.095Z","repository_id":5141562,"created_at":"2025-08-19T02:47:25.095Z","updated_at":"2025-08-19T02:47:25.095Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28755563,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T16:32:25.380Z","status":"ssl_error","status_checked_at":"2026-01-25T16:32:09.189Z","response_time":113,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autocommit","git"],"created_at":"2024-07-31T08:00:47.937Z","updated_at":"2026-01-25T17:06:28.402Z","avatar_url":"https://github.com/gitwatch.png","language":"Shell","funding_links":[],"categories":["Shell","git"],"sub_categories":[],"readme":"\u003c!-- Generated by github-markdown-toc --\u003e\n\n\u003c!-- gh-md-toc --insert README.md --\u003e\n\n\u003c!-- markdownlint-disable --\u003e\n\n\u003c!--ts--\u003e\n\n- [gitwatch](#gitwatch)\n  - [What to use it for?](#what-to-use-it-for)\n  - [Installation](#installation)\n    - [From Source](#from-source)\n      - [Update](#update)\n    - [bpkg](#bpkg)\n    - [Archlinux](#archlinux)\n    - [NixOS](#nixos)\n      - [As Module](#as-module)\n      - [As Package](#as-package)\n    - [Docker](#docker)\n      - [Docker Compose (Recommended)](#docker-compose-recommended)\n      - [Using the Dockerfile](#using-the-dockerfile)\n  - [Requirements](#requirements)\n    - [Notes for Mac](#notes-for-mac)\n  - [What it does](#what-it-does)\n  - [Usage](#usage)\n    - [Starting on Boot](#starting-on-boot)\n      - [SysVInit](#sysvinit)\n      - [systemd](#systemd)\n  - [Other Articles](#other-articles)\n    - [On the Gitwatch Wiki](#on-the-gitwatch-wiki)\n    - [Community Articles](#community-articles)\n\n\u003c!-- Added by: harleypig, at: Sun Mar  7 03:39:32 PM MST 2021 --\u003e\n\n\u003c!--te--\u003e\n\n\u003c!-- markdownlint-enable --\u003e\n\n# gitwatch\n\nA bash script to watch a file or folder and commit changes to a git repo\n\n## What to use it for?\n\nThat's really up to you, but here are some examples:\n\n- **config files**: some programs auto-write their config files, without\n  waiting for you to click an 'Apply' button; or even if there is such a\n  button, most programs offer you no way of going back to an earlier\n  version of your settings. If you commit your config file(s) to a git\n  repo, you can track changes and go back to older versions. This script\n  makes it convenient, to have all changes recorded automatically.\n- **document files**: if you use an editor that does not have built-in git\n  support (or maybe if you don't like the git support it has), you can use\n  gitwatch to automatically commit your files when you save them, or\n  combine it with the editor's auto-save feature to fully automatically and\n  regularly track your changes\n- _more stuff!_ If you have any other uses, or can think of ones, please\n  let us know, and we can add them to this list!\n\n## Installation\n\n`gitwatch` can be installed in various ways.\n\n### From Source\n\n`gitwatch` can be installed from source by simply cloning the repository\nand putting the shell script into your `$PATH`. The commands below will do\nthat for you if `/usr/local/bin` is in your `$PATH`. You may need to invoke\n`install` with `sudo`.\n\n```sh\ngit clone https://github.com/gitwatch/gitwatch.git\ncd gitwatch\n[sudo] install -b gitwatch.sh /usr/local/bin/gitwatch\n```\n\n#### Update\n\nIf you installed `gitwatch` from source, you can update it by following the\nexact same steps (or `git pull` rather than clone if you kept the\nrepository around).\n\n### bpkg\n\n`gitwatch` can be installed with [bpkg](https://github.com/bpkg/bpkg). Make\nsure you have [bpkg](https://github.com/bpkg/bpkg) installed before running\nthe command below. You may need to invoke `bpkg` with `sudo` when using the\n`-g` flag.\n\n```sh\n[sudo] bpkg install -g gitwatch/gitwatch\n```\n\n### Archlinux\n\nThere is an [AUR](https://aur.archlinux.org/packages/gitwatch-git/) package\nfor Archlinux. Install it with you favorite aur helper.\n\n### NixOS\n\nStarting from NixOS 24.11 this package available in mainline. Additionally,\nyou can use receipts from this repository.\n\n#### As Module\n\nEach watching path should be described in _submodule_ `services.gitwatch.*`\nlike next:\n\n```nix\nservices.gitwatch.\u003cservice name\u003e = {\n    enable = true;\n    path = \"/home/me/my-repo\";\n    remote = \"git@github.com:me/my-repo.git\";\n    user = \"me\";\n    message = \"Auto-commit by gitwatch on %d\";\n};\n```\n\nThis will make NixOS to create `systemd` service named\n`gitwatch-\u003cservice name\u003e`. More details you can see at\n`man configuration.nix`.\n\n#### As Package\n\nThe `gitwatch` script available as package in _nixpkgs_;\n\n## Docker\n\nYou can also run `gitwatch` inside a Docker container. This is useful for\nisolating dependencies and ensuring a consistent environment.\n\n### Docker Compose (Recommended)\n\nThe easiest way to run `gitwatch` with Docker is by using the provided\n`docker-compose.yml` file.\n\n**1. Prerequisites:**\n\n- **Docker and Docker Compose**: Make sure you have both installed.\n  - [Install Docker](https://docs.docker.com/get-docker/)\n  - [Install Docker Compose](https://docs.docker.com/compose/install/)\n- **A Git Repository**: You need a local directory that is a Git repository\n  you want to watch.\n- **SSH Key**: For pushing to a remote repository, the container needs\n  access to an SSH key that is authorized with your Git provider.\n\n**2. Docker Image Tags:**\n\nThis project publishes multiple Docker tags so you can choose the one that\nbest fits your use case.\n\nThe following image tags are available:\n\n- `:\u003cfull-sha\u003e`, `:\u003cshort-sha\u003e`\\\n  Always published for every build (immutable).\n\n- `:master`\\\n  Moving tag for the latest image from `master` branch.\n\n- `:vX.Y`, `:X.Y`\\\n  Published when a release tag `vX.Y` is pushed.\n\n- `:latest`\\\n  Updated when a `vX.Y` tag is pushed, pointing to the newest release\n  image.\n\n**3. Configuration:**\n\nThe `docker-compose.yml` file is configured using environment variables.\nYou can either edit the `environment` section directly in the file or\ncreate a `.env` file in the same directory to set the values.\n\nHere's a breakdown of the important parts of the `docker-compose.yml` file:\n\n- **`volumes`**: This is the most critical section to configure.\n  - `./watched-repo:/app/watched-repo`: This maps a directory from your\n    computer (the \"host\") into the container.\n    - You **must** change `./watched-repo` to the path of the local Git\n      repository you want `gitwatch` to monitor.\n  - `~/.ssh/id_rsa:/root/.ssh/id_rsa:ro`: This securely mounts your SSH\n    private key into the container in read-only mode (`ro`). This is\n    necessary for `gitwatch` to push changes to your remote repository.\n  - `~/.gitconfig:/root/.gitconfig:ro`: This mounts your Git configuration\n    into the container. This ensures that the commits made by `gitwatch`\n    are attributed to you with the correct name and email.\n- **`environment`**: This section controls how `gitwatch` behaves.\n\n\u003c!-- prettier-ignore-start --\u003e\n\n**4. Environment Variables**\n\nThe following environment variables are available for configuring the\n`gitwatch` container:\n\n| Variable           | Default Value          | Description                                                                                                                                                            |\n| :----------------- | :--------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `GIT_WATCH_DIR`    | `/app/watched-repo`    | The directory inside the container to watch for changes. This must match the container path you set in the `volumes` section.                                          |\n| `GIT_DIR`          | `/app/.git`            | Optional, but required if the .git directory is not located under `$GIT_WATCH_DIR/.git`. If used, this must match the container path you set in the `volumes` section. |\n| `GIT_REMOTE`       | `origin`               | The name of the remote repository to push to.                                                                                                                          |\n| `GIT_BRANCH`       | `main`                 | The branch to push to.                                                                                                                                                 |\n| `PULL_BEFORE_PUSH` | `\"false\"`              | Set to `\"true\"` to run `git pull --rebase` before every push.                                                                                                          |\n| `SLEEP_TIME`       | `2`                    | Time in seconds to wait after a file change before committing.                                                                                                         |\n| `COMMIT_MSG`       | `\"Auto-commit: %d\"`    | The commit message format. `%d` is replaced with the date/time.                                                                                                        |\n| `DATE_FMT`         | `\"+%Y-%m-%d %H:%M:%S\"` | The date format used in the commit message (see `man date` for options).                                                                                               |\n| `EXCLUDE_PATTERN`  | `\"\"`                   | A comma-separated list of patterns to exclude from monitoring (e.g., `\"*.log, *.tmp, tmp/\"`).                                                                          |\n| `SKIP_IF_MERGING`  | `\"false\"`              | Set to `\"true\"` to prevent commits when a merge is in progress.                                                                                                        |\n| `COMMIT_ON_START`  | `\"false\"`              | Set to \"true\" to commit any pending changes on startup.                                                                                                                |\n| `VERBOSE`          | `\"false\"`              | Set to \"true\" to enable verbose output for debugging.                                                                                                                  |\n\n\u003c!-- prettier-ignore-end --\u003e\n\n**5. Running gitwatch:**\n\n- **Start the container** in the background (detached mode):\n\n  ```sh\n  docker-compose up -d\n  ```\n\n- **View the logs** to see what `gitwatch` is doing:\n\n  ```sh\n  docker-compose logs -f\n  ```\n\n- **Stop the container**:\n\n  ```sh\n  docker-compose down\n  ```\n\n### Using the Dockerfile\n\nIf you prefer to build the Docker image yourself, you can use the provided\n`Dockerfile`. This is useful if you want to customize the image with\nadditional tools or dependencies.\n\n**1. Build the image:**\n\nFrom the root of the `gitwatch` repository, run:\n\n```sh\ndocker build -t gitwatch .\n```\n\n**2. Run the container:**\n\nTo run the container, you need to provide the same volumes and environment\nvariables as the Docker Compose setup.\n\n```sh\ndocker run -d \\\n    --name gitwatch \\\n    -v /path/to/your/repo:/app/watched-repo \\\n    -v ~/.ssh/id_rsa:/root/.ssh/id_rsa:ro \\\n    -v ~/.gitconfig:/root/.gitconfig:ro \\\n    -e GIT_WATCH_DIR=\"/app/watched-repo\" \\\n    -e GIT_REMOTE=\"origin\" \\\n    -e GIT_BRANCH=\"main\" \\\n    gitwatch\n```\n\n**Important:** Remember to replace `/path/to/your/repo` with the actual\npath to the Git repository you want to watch.\n\n## Requirements\n\nTo run this script, you must have installed and globally available:\n\n- `git` ([git/git](https://github.com/git/git) |\n  [git-scm](http://www.git-scm.com))\n- `inotifywait` (part of\n  **[inotify-tools](https://github.com/rvoicilas/inotify-tools)**)\n\n### Notes for Mac\n\nIf running on OS X, you'll need to install the following Homebrew tools:\n\n```sh\nbrew install fswatch\nbrew install coreutils\n```\n\n## What it does\n\nWhen you start the script, it prepares some variables and checks if the\nfile or directory given as input really exists.\n\nThen it goes into the main loop (which will run forever, until the script\nis forcefully stopped/killed), which will:\n\n- watch for changes to the file/directory using `inotifywait`\n  (`inotifywait` will block until something happens)\n- wait 2 seconds\n- case file:\n  - `cd` into the directory containing the file (because `git` likes to\n    operate locally)\n  - `git add \u003cfile\u003e`\n  - `git commit -m \"Scripted auto-commit on change (\u003cdate\u003e)\"`\n- case directory:\n  - `cd` into the directory (because `git` likes to operate locally)\n  - `git add --all .`\n  - `git commit -m \"Scripted auto-commit on change (\u003cdate\u003e)\"`\n- if a remote is defined (with `-r`) do a push after the commit (a specific\n  branch can be selected with `-b`)\n\nNotes:\n\n- the waiting period of 2 sec is added to allow for several changes to be\n  written out completely before committing; depending on how fast the\n  script is executed, this might otherwise cause race conditions when\n  watching a folder\n- currently, folders are always watched recursively\n\n## Usage\n\n`gitwatch.sh [-r \u003cremote\u003e [-b \u003cbranch\u003e]] \u003cfile or directory to watch\u003e`\n\nIt is expected that the watched file/directory are already in a git\nrepository (the script will not create a repository). If a folder is being\nwatched, this will be watched fully recursively; this also means that all\nfiles and sub-folders added and removed from the directory will always be\nadded and removed in the next commit. The `.git` folder will be excluded\nfrom the `inotifywait` call so changes to it will not cause unnecessary\ntriggering of the script.\n\nIf you have any large files in your repository that are changing\nfrequently, you might wish to ignore them with a `.gitignore` file.\n\n### Starting on Boot\n\nIf you want to have the script auto-started upon boot, the method to do\nthis depends on your operating system and distribution. If you have a GUI\ndialog to set up startup launches, you might want to use that, so you can\nmore easily find and change the startup script calls later on.\n\nPlease also note that if either of the paths involved (script or target)\ncontains spaces or special characters, you need to escape them accordingly;\nif you don't know how to do that, the internet will help you, or feel free\nto ask here or contact me directly.\n\n#### SysVInit\n\nA central place to put startup scripts on Linux is generally\n`/etc/rc.local` (to my knowledge; only tested and confirmed on Ubuntu).\nThis file, if it has the +x bit, will be executed upon startup, **by the\nroot user account**. If you want to start `gitwatch` from `rc.local`, the\nrecommended way to call it is:\n\n\u003c!-- markdownlint-disable --\u003e\n\n`su -c \"/absolute/path/to/script/gitwatch.sh /absolute/path/to/watched/file/or/folder\" -l \u003cusername\u003e \u0026`\n\n\u003c!-- markdownlint-restore --\u003e\n\nThe `\u003cusername\u003e` bit should be replaced with your username or that of any\nother (non-root) user account; it only needs write-access to the git\nrepository of the file/folder you want to watch. The ampersand (`\u0026`) at the\nend sends the launched process into the background (this is important if\nyou have other calls in `rc.local` after the mentioned line, because the\n`gitwatch` call does not usually return).\n\n#### systemd\n\n- If installed to a path other than `/usr/local/bin/gitwatch`, modify\n  `gitwatch@.service` to suit\n- Create dir if it does not exist and copy systemd service file with\n  `mkdir -p \"$HOME/.config/systemd/user\" \u0026\u0026 cp gitwatch@.service $HOME/.config/systemd/user`\n- Start and enable the service for a given path by running\n  `systemctl --user --now enable gitwatch@$(systemd-escape \"'-r url/to/repository' /path/to/folder\").service`\n\n## Other Articles\n\n### On the Gitwatch Wiki\n\n- [How to Install `Gitwatch` as a Debian Service With `supervisord`](https://github.com/gitwatch/gitwatch/wiki/gitwatch-as-a-service-on-Debian-with-supervisord)\n\n### Community Articles\n\n- [How To Use `Gitwatch` by Maisa Milena](https://medium.com/@maisa.milena/how-to-use-gitwatch-92c72e8ea4c4)\n- [Syncing and Backing Up Your Thoughts with `Obsidian`, `Syncthing`, and `Gitwatch` by Vinícius Costa](https://viniciusnevescosta.medium.com/syncing-and-backing-up-your-thoughts-with-obsidian-syncthing-and-gitwatch-a55670b2b63f)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitwatch%2Fgitwatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgitwatch%2Fgitwatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitwatch%2Fgitwatch/lists"}