Simple Windows program to keep your heatmap green.
This program uses Python with a package called GitPython
.
Create a private dummy repository. For example, a simple repo with a text file.
Clone the repo to your desktop. Make sure that text file is there.
Create a virtual environment in the repo you cloned. Use the command python3 -m virtualenv [name]
. Replace [name]
with the name of your virtual environment. If the package virtualenv
has not been found, install it using python3 -m pip install virtualenv
. After creating the virtual environment, you should see a folder in your cloned repository folder.
Now activate your virtual environment using [name]/scripts/activate
(if you're on Windows).
Use python3 -m pip install gitpython
. Wait until installed successfully.
Copy and paste the file autogit.pyw
from this repo to your cloned repository folder on your desktop. You can edit the times of each commit and push for your dummy repo in the file. The default times are:
times = [
"00:01",
"09:00",
"11:00",
"13:00",
"15:00",
"17:00",
"21:00",
"22:00",
]
Edit the name of the text file you kept in the private repo by replacing line 38 from autogit.pyw
: file_path = "[name].txt"
.
Keep in mind that your machine needs to be running during this time while connected to a working internet to be able to commit and push.
Hit Windows Key + R
then type shell:startup
. This should bring up your startup program folder. Create a new file in the folder called start.bat
. Copy and paste the contents below to start.bat
:
@echo off
cd /d "C:\PATH\TO\CLONED\REPO\HERE"
call venv/scripts/activate
python autogit.pyw
pause
Replace the text "C:\PATH\TO\CLONED\REPO\HERE"
in line 2 to the path where your cloned repo is located on your desktop.
A command prompt will pop up. This is the program running, leave this window open. The next time you reboot your computer, the program will run automatically.
So yeah, if you're a lazy ass like me, use this program to stay ahead of the game (by cheating basically).