Skip to content

Instantly share code, notes, and snippets.

@rosharp
Created April 17, 2022 09:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rosharp/c195e67318362ed603148058875327e0 to your computer and use it in GitHub Desktop.
Save rosharp/c195e67318362ed603148058875327e0 to your computer and use it in GitHub Desktop.
Automatically Commit & Push git repository once in every X day/minute/hours
  1. Navigate into the desired repository, create the autocommit.bat file 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)
  1. Open Task Scheduler (from Start/search) and Create Basic task.

  2. 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.

That’s all!

You can see all scheduled tasks under Task Scheduler Library > Active Tasks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment