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 [2022/01/09 18:14] – niccolo | doc:appunti:prog:git [2024/02/12 11:07] (current) – [Chiave SSH per Github.com] niccolo | ||
---|---|---|---|
Line 256: | Line 256: | ||
===== Misc Commands ===== | ===== Misc Commands ===== | ||
- | ==== Revert | + | ==== Restore o revert |
+ | |||
+ | A partire da Git 2.23 esiste il comando **git restore** che consente di ripristinare un file modificato localmente alla sua versione di checkout: | ||
+ | |||
+ | < | ||
+ | git restore path/ | ||
+ | </ | ||
+ | |||
+ | Con versioni precedenti di Git si può usare: | ||
+ | |||
+ | < | ||
+ | git checkout -- path/ | ||
+ | </ | ||
+ | |||
+ | Se si desidera tornare ad uno specifico commit, si può visualizzare il log degli stessi e richiederlo esplicitamente: | ||
< | < | ||
git log path/ | git log path/ | ||
- | git checkout <commit> path/ | + | git checkout <commit_id> path/ |
</ | </ | ||
Line 347: | Line 361: | ||
ssh -T git@github.com | ssh -T git@github.com | ||
Hi RigacciOrg! You've successfully authenticated, | Hi RigacciOrg! You've successfully authenticated, | ||
- | </code< | + | </code> |
Verifichiamo che un repository locale sia stato clonato tramite protocollo HTTPS: | Verifichiamo che un repository locale sia stato clonato tramite protocollo HTTPS: |
doc/appunti/prog/git.1641748450.txt.gz · Last modified: 2022/01/09 18:14 by niccolo