tldr/pages.it/common/git-switch.md

30 lines
746 B
Markdown
Raw Normal View History

# git switch
2021-01-07 14:06:38 +00:00
> Passa ad altri rami. Richiede versioni di Git successive alla 2.23.
> Vedi anche `git checkout`.
> Maggiori informazioni: <https://git-scm.com/docs/git-switch>.
- Passa ad un altro ramo esistente:
`git switch {{nome_ramo}}`
- Crea un nuovo ramo e passa a quel ramo:
`git switch --create {{nome_ramo}}`
- Crea un nuovo ramo a partire da un commit esistente e passa a quel ramo:
`git switch --create {{nome_ramo}} {{commit}}`
- Torna al ramo precedente:
`git switch -`
- Passa ad un ramo ed aggiorna tutti i moduli secondari associati:
`git switch --recurse-submodules {{nome_ramo}}`
- Passa ad un ramo e uniscilo automaticamente al ramo corrente, include le modifiche non committate:
`git switch --merge {{nome_ramo}}`