Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions auto_commit.bat
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions log.txt
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Test Commit - Thu Mar 13 18:38:31 WEST 2025