Skip to content

Commit cfcd1a1

Browse files
committed
.
1 parent 201a777 commit cfcd1a1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

git-push.bat

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@echo off
2+
for /f %%i in ('git rev-parse --abbrev-ref HEAD') do set current_branch=%%i
3+
for /f %%i in ('git rev-list origin/%current_branch%..HEAD ^| find /c /v ""') do set pending_commits=%%i
4+
if %pending_commits% gtr 0 (
5+
echo There are %pending_commits% commits pending to be pushed in branch %current_branch%.
6+
git push origin %current_branch%
7+
echo Push completed for branch %current_branch%.
8+
) else (
9+
echo No commits pending to be pushed in branch %current_branch%.
10+
)
11+
pause

0 commit comments

Comments
 (0)