diff --git a/auto_commit.bat b/auto_commit.bat new file mode 100644 index 000000000..15e04ce97 --- /dev/null +++ b/auto_commit.bat @@ -0,0 +1,34 @@ +@echo off +cd /d C:\Users\ACER-NITRO\Desktop\github\datasharing + +:: Generate a random number of commits (between 2 and 5) +set /a commits=%random% %% 4 + 2 + +:: Debugging message +echo "Starting Auto Commit Script..." +echo "Total Commits: %commits%" +echo. + +:: Loop through commits with individual push per commit +for /L %%i in (1,1,%commits%) do ( + echo "Committing: %%i / %commits% at %time%" + + echo Log entry %date% %time% >> log.txt + git add log.txt + + git commit -m "Auto-update: %date% %time%" || ( + echo "Commit failed!" + exit /b + ) + + :: Push after every commit + git push origin main || ( + echo "Push failed!" + exit /b + ) + + timeout /t 5 >nul +) + +echo "Finished all commits." +exit diff --git a/log.txt b/log.txt new file mode 100644 index 000000000..efdf4aa0c --- /dev/null +++ b/log.txt @@ -0,0 +1,12 @@ +Log entry Thu 03/13/2025 18:32:57.58 +Log entry Thu 03/13/2025 18:33:02.14 +Log entry Thu 03/13/2025 18:46:22.48 +Log entry Thu 03/13/2025 18:46:22.48 +Log entry Thu 03/13/2025 18:46:22.48 +Log entry Thu 03/13/2025 18:46:22.48 +Log entry Thu 03/13/2025 18:49:23.20 +Log entry Thu 03/13/2025 18:49:23.20 +Log entry Thu 03/13/2025 18:49:23.20 +Log entry Thu 03/13/2025 18:49:23.20 +Log entry Thu 03/13/2025 18:50:57.65 +Log entry Thu 03/13/2025 18:50:57.65 diff --git a/test.txt b/test.txt new file mode 100644 index 000000000..69de3b19e --- /dev/null +++ b/test.txt @@ -0,0 +1 @@ +Test Commit - Thu Mar 13 18:38:31 WEST 2025