Torna al blog

Comandi Git per sostituire un branch con un altro branch

2022-09-011 min di lettura
  1. git branch -m my_feature_branch my_feature_branch_new_name # Rinomina my_feature_branch
  2. git checkout my_feature_branch_new_name && git push origin my_feature_branch_new_name # Invia il backup all'origine, in modo che sia lì come riferimento per gli altri membri del team.
  3. git checkout master # Effettua il checkout sul branch che sostituirà my_feature_branch.
  4. git checkout -b my_feature_branch # Crea un nuovo my_feature_branch partendo dal branch master nel mio esempio.
  5. git push origin my_feature_branch -f # Forzerà l'invio del nuovo branch anche all'origine

Categorie: