Prompt file imported from radicepiero/TENNIS_GAME_MONOREPO (
.windsurf/workflows/commit-and-merge.md). Copyright stays with the author.
Obiettivo
Portare le modifiche locali su GitHub e allineare master in modo pulito.
Contesto
- Questo workflow è locale (Windows / PowerShell).
- Non include deploy sul droplet.
Passi
-
Verifica di essere nella repo corretta
- Controlla che il terminale sia aperto sulla root del monorepo.
-
Controlla lo stato Git
- Comando (PowerShell):
git status
- Comando (PowerShell):
-
(Opzionale) Controlla cosa stai per committare
- Comandi:
git diffgit diff --cached
- Comandi:
-
Stage selettivo oppure totale
- Se vuoi aggiungere tutto:
git add .
- Se vuoi aggiungere solo alcuni file:
git add <paths...>
- Se vuoi aggiungere tutto:
-
Commit
- Comando:
git commit -m "<messaggio>"
- Comando:
-
Push del branch corrente
- Se stai lavorando su
master:git push origin master
- Se stai lavorando su un feature branch:
git push -u origin <branch>
- Se stai lavorando su
-
Merge su
master- Caso A: merge fatto via GitHub PR
- Verifica che
origin/mastersia aggiornato. - Poi riallinea in locale con rebase:
git fetch origingit pull --rebase origin master
- Verifica che
- Caso B: merge in locale
- Checkout
master:git checkout master
- Allinea
mastercon remoto:git pull --rebase origin master
- Merge del branch:
git merge <branch>
- Push:
git push origin master
- Checkout
- Caso A: merge fatto via GitHub PR
-
Pulizia: working tree pulito
- Verifica finale:
git status
- Verifica finale:
Note
- Se
git push origin masterfallisce connon-fast-forward, integra primaorigin/master:- consigliato:
git pull --rebase origin master
- consigliato:
- Se hai modifiche locali “rumorose” (es. file tracciati ma non ti interessano), usa
git stash(consigliato) ogit restore.
