Skip to content
3vorpPublic

About

A small tool to automatically pull Git repositories on a given interval using cron or Windows Task Scheduler. Uncommitted changes are preserved and merged as possible.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

Autopull

A small tool to automatically pull Git repositories on a given interval using cron or Windows Task Scheduler. Uncommitted changes are preserved and merged as possible.

Setup

  1. Install Node.js v22+ and make sure Git is installed on your machine.
  2. Place the repository contents (either cloned or unzipped) somewhere it won't move. I recommend creating a folder inside $HOME/.config, but any location will work.
  3. Rename the config.example.json file to config.json to fit your cloned Git repository paths. You can add multiple Git repositories inside a single base directory using the basePath and items keys, and any number of base folders by adding more items to the array. See config.example.json for a more comprehensive example of the schema.

*nix Scheduling

To add the script to your crontab, run this command in any shell:

crontab -e

Paste 0 * * * * /usr/local/bin/node /path/to/autopull/index.js > /dev/null in the file and save its contents.

Windows Scheduling

Create a new task in the Task Scheduler that runs at your desired interval. Set the action to run wscript.exe with the argument being the full path to the runScript.vbs file.

Configuration

*nix

By default, your repositories will be pulled every hour. If you want to adjust this interval, change the schedule expression at the start of the line to whatever interval you want (you can access the schedule by running crontab -e again). This website is a handy tool for generating cron intervals.

Windows

To match the cron schedule, set the Trigger to "Daily" and repeat the task every 1 hour for a duration of "Indefinitely".

About

A small tool to automatically pull Git repositories on a given interval using cron or Windows Task Scheduler. Uncommitted changes are preserved and merged as possible.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages