doc:appunti:prog:git
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| doc:appunti:prog:git [2026/03/14 15:46] – [Annullare le modifiche locali] niccolo | doc:appunti:prog:git [2026/11/06 10:51] (current) – [git restore] niccolo | ||
|---|---|---|---|
| Line 66: | Line 66: | ||
| cd qgis-web-client | cd qgis-web-client | ||
| git pull | git pull | ||
| + | </ | ||
| + | |||
| + | ==== git add ==== | ||
| + | |||
| + | Se nel repository locale di un progetto si aggiunge un file, questo risulta come //untracked file// (vedere con '' | ||
| + | |||
| + | < | ||
| + | git add filename | ||
| + | </ | ||
| + | |||
| + | Se si sono aggiunte diverse directory e file al progetto, è possibile aggiungerli tutti al sistema di tracking di Git con: | ||
| + | |||
| + | < | ||
| + | git add -A | ||
| + | </ | ||
| + | |||
| + | ==== git restore ==== | ||
| + | |||
| + | Se un file viene modificato nel repositori locale e **non è stato committed** né pushed nel repository origine, è possibile riportarlo alla versione precedente con: | ||
| + | |||
| + | < | ||
| + | git restore nomefile | ||
| </ | </ | ||
| Line 96: | Line 118: | ||
| git remote add origin_rw git@github.com: | git remote add origin_rw git@github.com: | ||
| git push origin_rw | git push origin_rw | ||
| + | </ | ||
| + | |||
| + | ==== git pull --rebase ==== | ||
| + | |||
| + | Può capitare che un '' | ||
| + | |||
| + | < | ||
| + | git pull --rebase | ||
| + | git push | ||
| </ | </ | ||
| Line 371: | Line 402: | ||
| Purtroppo questa configurazione non può essere utilizzata per ignorare una intera directory. | Purtroppo questa configurazione non può essere utilizzata per ignorare una intera directory. | ||
| + | |||
| + | ===== .gitignore ===== | ||
| + | |||
| + | Supponiamo che nella radice di un progetto Git si abbia il file **.gitignore** che contiene: | ||
| + | |||
| + | < | ||
| + | # --- Gradle & build output --- | ||
| + | .gradle/ | ||
| + | build/ | ||
| + | |||
| + | # --- Local, machine-specific config --- | ||
| + | local.properties | ||
| + | |||
| + | # --- Signing secrets: NEVER commit these --- | ||
| + | *.jks | ||
| + | *.keystore | ||
| + | keystore.properties | ||
| + | |||
| + | # --- IDE / editor (not used here) --- | ||
| + | *.iml | ||
| + | .idea/ | ||
| + | .vscode/ | ||
| + | |||
| + | # --- OS cruft --- | ||
| + | .DS_Store | ||
| + | Thumbs.db | ||
| + | |||
| + | # --- Misc --- | ||
| + | *.log | ||
| + | captures/ | ||
| + | </ | ||
| + | |||
| + | ad esempio la riga **build/** significa che qualsiasi cartella con quel nome verrà ignorata, ad esmepio **/build/** e **/ | ||
| + | |||
| + | Il progetto può includere altri **.gitignore** in sottocartelle, | ||
| + | |||
| ===== Chiave SSH per Github.com ===== | ===== Chiave SSH per Github.com ===== | ||
doc/appunti/prog/git.1773499593.txt.gz · Last modified: by niccolo
