[Windows] Automatically Commit & Push git repository once in every X day/minute/hours
There are people when have specific needs (like us) who want to setup a “cron”-like task to auto-commit & push the changes to remote repository.
This can be done in Windows with the following steps:
- Navigate into the desired repository, create the
autocommit.batfile with the below contents:
git add -u REM :: Only add tracked files git commit -m "your commit message" REM :: Commit all your added files git push origin master REM :: Branch (i.e. master)
Task Scheduler (from Start/search) and
Create Basic task:
3) Name it i.e.
my XYZ repo autocommit , follow the “Next” buttons and choose your
autocommit.bat file, and choose periodicity it will run every “X” days once.
You can see all scheduled tasks under
Task Scheduler Library > Active Tasks