{"id":27450149,"url":"https://github.com/programming-sai/gitguardian","last_synced_at":"2026-05-07T08:35:53.761Z","repository":{"id":287616554,"uuid":"965134375","full_name":"Programming-Sai/GitGuardian","owner":"Programming-Sai","description":"A Windows-based automation tool that automatically pushes the contents of a specified folder to GitHub at fixed intervals using Task Scheduler, lockfiles, and bat scripting. Designed to help developers maintain commit streaks effortlessly.","archived":false,"fork":false,"pushed_at":"2025-04-12T20:19:36.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-15T09:12:59.283Z","etag":null,"topics":["automation","bat","commit-streak","dev-tools","git","productivity","scripting","task-schedulre","windows"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Programming-Sai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2025-04-12T13:43:34.000Z","updated_at":"2025-04-12T20:19:39.000Z","dependencies_parsed_at":"2025-04-12T21:26:49.774Z","dependency_job_id":"01bf28cc-6fb7-484b-8c4d-e1a757278f76","html_url":"https://github.com/Programming-Sai/GitGuardian","commit_stats":null,"previous_names":["programming-sai/gitguardian"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Programming-Sai%2FGitGuardian","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Programming-Sai%2FGitGuardian/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Programming-Sai%2FGitGuardian/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Programming-Sai%2FGitGuardian/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Programming-Sai","download_url":"https://codeload.github.com/Programming-Sai/GitGuardian/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249040155,"owners_count":21202825,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["automation","bat","commit-streak","dev-tools","git","productivity","scripting","task-schedulre","windows"],"created_at":"2025-04-15T09:13:12.174Z","updated_at":"2026-05-07T08:35:53.756Z","avatar_url":"https://github.com/Programming-Sai.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitGuardian\n\nAn automated tool to commit and push the contents of a specified folder to GitHub at scheduled intervals—leveraging PowerShell scripts, lockfiles, and WSL cron.\n\n---\n\n## Repository Structure\n\n```text\nGitGuardian/\n├── .fttignore\n├── .gitignore\n├── config.txt                  # Defines script names, lockfile, log locations, and repo folder\n├── git-push.bat                # Batch script: adds, commits, and pushes\n├── main-runner.ps1             # PowerShell orchestration: lockfile \u0026 script invocation\n└── README.md                   # Project documentation (this file)\n```\n\n---\n\n## How It Works\n\n1. **Load Configuration** (`config.txt`)\n\n   - `GIT_SCRIPT`: name of the batch file (e.g., `git-push.bat`)\n   - `LOCK_FILE`: filename for the lockfile to prevent overlapping runs\n   - `LOG_FILE`: filename for appending commit logs\n   - `GIT_FOLDER`: path to the local Git repository (use your own path)\n\n2. **PowerShell Runner** (`main-runner.ps1`)\n\n   - Reads key/value pairs from `config.txt`\n   - Validates that the batch script exists in the project root\n   - Checks for a stale lockfile (deletes if older than 60 minutes)\n   - Creates a new lockfile, sets environment variables, and `cd` into `%GIT_FOLDER%`\n   - Invokes the batch script to commit and push with a timestamped message\n   - Removes the lockfile on completion\n\n3. **Commit \u0026 Push** (`git-push.bat`)\n\n   - Requires a commit message argument and a valid `.git` directory\n   - Stages all changes, commits, and pushes to the remote branch\n   - Outputs status and errors to the log file defined in `config.txt`\n\n4. **Scheduling**\n\n   - Define cron jobs in WSL to invoke the PowerShell script at desired times\n   - **Example cron entries** (place under your own user with `crontab -e`):\n\n     ```cron\n     # Early morning (e.g., 2‑4 AM)\n     0 2-4 * * * powershell.exe -ExecutionPolicy Bypass -File \"\u003cpath-to\u003e/main-runner.ps1\" \u003e\u003e \"\u003cpath-to\u003e/git_push.log\" 2\u003e\u00261\n\n     # Mid-afternoon (e.g., 3‑4 PM)\n     0 15-16 * * * powershell.exe -ExecutionPolicy Bypass -File \"\u003cpath-to\u003e/main-runner.ps1\" \u003e\u003e \"\u003cpath-to\u003e/git_push.log\" 2\u003e\u00261\n     ```\n\n   - Replace `\u003cpath-to\u003e` with the absolute or relative path to your project folder\n\n---\n\n## Prerequisites\n\n- **Windows 10/11** with **WSL (Ubuntu)** installed\n- **Git** available on Windows (and optionally in WSL)\n- **PowerShell** (built‑in to Windows)\n\n---\n\n## Manual Testing\n\nRun the orchestration script directly to verify before scheduling:\n\n```powershell\n# Replace \u003cpath-to\u003e with your project directory\npowershell.exe -ExecutionPolicy Bypass -File \"\u003cpath-to\u003e\\main-runner.ps1\"\n```\n\nCheck the log file for confirmation of commits and any errors.\n\n---\n\n## Customization\n\n- **Scheduling**: adjust time fields in your crontab entries via `crontab -e`.\n- **Configuration**: modify `config.txt` entries (script names, filenames, repo path).\n- **Branching/Tags**: update `git-push.bat` to handle additional Git options if needed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogramming-sai%2Fgitguardian","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprogramming-sai%2Fgitguardian","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogramming-sai%2Fgitguardian/lists"}