Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to auto commit and push on github?

Tags:

git

github

I am using windows and i am completely new to github. I have installed desktop client. I wanted a single txt file to automatically uploaded to my github repository when it's changed or updated locally. I want this to completely automatic process as file is also getting updated automatically every hour and as soon as file gets updated i want it to be commit and pushed to my github repository.

like image 311
xorro Avatar asked Dec 07 '25 04:12

xorro


1 Answers

To auto commit every one hour you can create a batch file (.bat) with this content:

cd C:\path\to\your\git\project
git add --all
git commit -m "autoCommit %date:~-4%%date:~3,2%%date:~0,2%.%time:~0,2%%time:~3,2%%time:~6,2%"
git push
exit

Create a task on the Task Scheduler and run this file every one hour.

(You can also run it every 1 minute and you will be updated almost in "real time").

like image 51
Shayki Abramczyk Avatar answered Dec 08 '25 18:12

Shayki Abramczyk