Could I do take commit my changes in a directory by a daily routine? Say, In every 12 AM at early morning, It should commit all the changes in that directory automatically? Is it possible in git? I get some answers for auto commit for every changes. But I want it for daily once commit.
If you commit, push. Ideally, you should commit every time you check off a task. You should never commit a half-written function without first writing comments and perhaps even some pseudo code. The same goes for a file.
If you simply want to commit ALL changes every morning at 12 AM, you can do this using a cronjob.
Assuming that you are using a linux distribution with bash, you can write a bash script that does the commit
#!/bin/bash
cd <git directory> && git add -A && git commit * --allow-empty-message -m ''
Then you can place this cron job in /etc/cron.d/
0 0 * * * <username> /bin/bash <script location>
If you intend to run this as your own user only then you can instead add it to your personal crontab interactively by running
crontab -e
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With