Commit to repo every day for the perfect commit streak
pip install -r requirements.txt
- Download this repository.
- Create your own repository on your GitHub account.
- It's very important to first commit the
update_me.yamlfile first before you begin the daily commit.
- That's really it.. Assuming your logged into git on your system it should work fine.
Now that your repository and git is setup, its time to set up the most important part. DAILY commit. Since the script handles all of the updates and processing, all we need to do is call that script. There are alot of ways to achieve this, depending on what operating system you are on. Below are instructions for both Windows and Linux solutions, you can do this how ever you feel.
- If for some reason it doesn't commit, re-clone or merge the repository to your PC again. It's just a funny issue it has.
I will be showing you how to set this up using task sceduler on windows.
- Open 'Task Scheduler' from search bar.
- Press 'Create Task...'.
- Name it: "Daily Git Commit" just so you know what it is later on, and not some wierd virus.
- I would suggest, to check both of the following: "Run with highest privileges" to insure no issues ever occure when reading and writing to files, and: "Run where user is logged on or not" Just so you never miss a day when your PC is logged out.
- Head over to the "Triggers" tab, and create a "New" trigger.
- Set the trigger to DAILY (or how ever you want :) ) and set the time how ever you want. Make sure the "Status" is: "Enabled"
- Next go to the "Actions" tab. (This is where we specify what program to run.
- Press "Browse" and go to the path of the
run.batscript and double click it. There is no need for additional arguments. Press OK.
- There are a few additions settings you can change in the "Settings" tab, such as if the task fails restart it every couple seconds, maybe a network error. Run task ASAP. There is not more to setup, this is pretty much it for windows setup.
- Make sure you edit the
run.batfile to the correct paths.
- If for some reason, the directory changed/
run.batgot renamed or deleted/or you deleted the project and re-downloaded. REPEAT step 8.
- If there are errors that occur, open up an issue and I will get it fixed ASAP.
I will be using
- Open crontab with:
sudo crontab -e
- Add the following line:
59 23 * * * cd /path/to/script/folder/ ; /usr/bin/env /usr/local/bin/python3.8 /path/to/script/main.py
- Thats it! Make sure you save and exit.
Note. There may be git config issues, I solved them by generating a GitHub token in the developer settings. Using the github token as a login for git, make sure git is logged in your system.
Additional information about crontab
Only because I wanted to. I hate to see my git commit stats have gaps, and so I made this SUPER simple script to create a commit to this repository to bring up my commit streak :P, and to fill in the gaps where I don't commit on one day. Again this is just a silly project and has no purpose besides to 'cure my ocd' for a perfect commit streak :D. I hope if you have the same issue this script will help.
Short answer: NO!
Detailed answer: I asked this question on stackoverflow, and any other question you have is answered there!