-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpush.bat
More file actions
33 lines (27 loc) · 944 Bytes
/
push.bat
File metadata and controls
33 lines (27 loc) · 944 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
@echo off
:: Script to add, commit, and push untracked files one by one in a Git repository, with progress status
setlocal enabledelayedexpansion
:: Initialize counters
set total=0
set count=0
:: Fetch the list of untracked files and count them
for /f "tokens=*" %%f in ('git status --porcelain ^| findstr "^??"') do (
set /a total+=1
)
:: Process each untracked file
for /f "tokens=*" %%f in ('git status --porcelain ^| findstr "^??"') do (
set file=%%f
:: Remove the '?? ' prefix to get the file path
set file=!file:?? =!
set /a count+=1
echo Processing file [!count! of !total!]: "!file!"
:: Git add, commit, and push
git add "!file!"
git commit -m "Adding file: !file!"
git push
echo Completed processing for: "!file!"
echo --------------------------------------
)
:: Final message
echo All untracked files have been added, committed, and pushed.
pause