oh-my-git/levels/it_IT/branches/reorder

90 lines
1.8 KiB
Text
Raw Normal View History

2021-09-14 12:18:31 +02:00
title = Muovere i rami
2021-01-13 16:26:48 +01:00
cards = checkout commit-auto merge reset-hard
[description]
2021-09-14 12:18:31 +02:00
Uno dei tuoi colleghi ha fatto un casino qui e ha messo le branches nelle line temporali sbagliate!
2021-01-13 16:26:48 +01:00
2021-09-14 12:18:31 +02:00
Potresti cancellare e ricreare queste branches - ma puoi anche muoverle direttamente in un differente commit usando:
2021-01-13 16:26:48 +01:00
git checkout
2021-09-14 12:18:31 +02:00
nel nome della branch e poi usare
git reset --hard
2021-09-14 12:18:31 +02:00
nel commit dove vuoi che la branch vada.
2021-09-14 12:18:31 +02:00
La ciambella è nella branch giusto ma la linea temporale è incompleta - fai *mangiare* la ciambella a quella branch!
2021-01-13 16:26:48 +01:00
[setup]
2021-09-14 12:18:31 +02:00
echo "Tu non hai una baguette.
2021-01-13 16:26:48 +01:00
2021-09-14 12:18:31 +02:00
Non hai un caffe.
2021-01-13 16:26:48 +01:00
2021-09-14 12:18:31 +02:00
Non hai una ciambella." > you
2021-01-13 16:26:48 +01:00
git add .
2021-09-14 12:18:31 +02:00
git commit -m "L'inizio"
2021-01-13 16:26:48 +01:00
git checkout -b coffee
2021-09-14 12:18:31 +02:00
echo "Tu hai una baguette.
2021-01-13 16:26:48 +01:00
2021-09-14 12:18:31 +02:00
Non hai un caffe.
2021-01-13 16:26:48 +01:00
2021-09-14 12:18:31 +02:00
Non hai una ciambella." > you
2021-01-13 16:26:48 +01:00
git add .
2021-09-14 12:18:31 +02:00
git commit -m "Compri una ciambella"
2021-01-13 16:26:48 +01:00
2021-09-14 12:18:31 +02:00
echo "Mangi una baguette.
2021-01-13 16:26:48 +01:00
2021-09-14 12:18:31 +02:00
Non hai un caffe.
2021-01-13 16:26:48 +01:00
2021-09-14 12:18:31 +02:00
Non hai una ciambella." > you
2021-01-13 16:26:48 +01:00
git add .
2021-09-14 12:18:31 +02:00
git commit -m "Mangi una baguette"
2021-01-13 16:26:48 +01:00
git checkout -b baguette main
2021-09-14 12:18:31 +02:00
echo "Non hai una ciambella.
2021-01-13 16:26:48 +01:00
2021-09-14 12:18:31 +02:00
Hai un caffe.
2021-01-13 16:26:48 +01:00
2021-09-14 12:18:31 +02:00
Non hai una ciambella." > you
2021-01-13 16:26:48 +01:00
git add .
2021-09-14 12:18:31 +02:00
git commit -m "Compri un pò di caffe"
2021-01-13 16:26:48 +01:00
2021-09-14 12:18:31 +02:00
echo "Non hai una baguette.
2021-01-13 16:26:48 +01:00
2021-09-14 12:18:31 +02:00
Hai bevuto caffe.
2021-01-13 16:26:48 +01:00
2021-09-14 12:18:31 +02:00
Non hai una ciambella." > you
2021-01-13 16:26:48 +01:00
git add .
2021-09-14 12:18:31 +02:00
git commit -m "Bevi il caffe"
2021-01-13 16:26:48 +01:00
git checkout -b donut main
2021-09-14 12:18:31 +02:00
echo "Non hai una baguette.
2021-01-13 16:26:48 +01:00
2021-09-14 12:18:31 +02:00
Non hai caffe.
2021-01-13 16:26:48 +01:00
2021-09-14 12:18:31 +02:00
Hai una ciambella." > you
2021-01-13 16:26:48 +01:00
git add .
2021-09-14 12:18:31 +02:00
git commit -m "Compri una ciambella"
2021-01-13 16:26:48 +01:00
git checkout --detach main
[win]
2021-09-14 12:18:31 +02:00
# Mangi una baguette nella branch delle baguette?
git show baguette:you | grep "Mangi.*baguette"
2021-01-13 16:26:48 +01:00
2021-09-14 12:18:31 +02:00
# Bevi un caffe nella branch del caffe?
git show coffee:you | grep "Bevi.*coffe"
2021-01-13 16:26:48 +01:00
2021-09-14 12:18:31 +02:00
# Mangi una ciambella nella branch delle ciambelle?
git show donut:you | grep "Mangi.*ciambella"
2021-01-13 16:26:48 +01:00
[actions]
2021-09-14 12:18:31 +02:00
test "$(git rev-parse HEAD^)" = "$(git rev-parse donut)" && hint "Ricordati di controllare l'etichetta branch blue quando vuoi che cresca con la linea temporale."