-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauto-push.bat
More file actions
44 lines (34 loc) · 825 Bytes
/
Copy pathauto-push.bat
File metadata and controls
44 lines (34 loc) · 825 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
34
35
36
37
38
39
40
41
42
43
44
@echo off
cd /d "%~dp0"
echo ==========================
echo Git Commit Automático
echo ==========================
echo.
:: Ver repositório remoto
git remote -v
echo.
:: Verifica se há mudanças
git status | findstr "Changes not staged for commit" > nul
if %errorlevel% neq 0 (
git status | findstr "Untracked files" > nul
if %errorlevel% neq 0 (
echo.
echo Nenhuma alteração detectada. Nada para comitar.
pause
exit /b
)
)
:: Mensagem do commit
set /p msg="Digite a mensagem do commit: "
:: Add e commit primeiro
git add .
git commit -m "%msg%"
:: Agora é seguro puxar antes de push
echo.
echo Puxando alterações do GitHub com rebase...
git pull origin main --rebase
:: Push final
git push -u origin main
echo.
echo Commit e push concluídos com sucesso!
pause