El siguiente ejemplo es muy similar, pero requiere una combinación de 3 vías porque main progresa mientras la característica está en progreso. Este es un escenario común para funciones grandes o cuando varios desarrolladores están trabajando en un proyecto simultáneamente.
Start a new feature
git checkout -b new-feature main
# Edit some files
git add <file>
git commit -m "Start a feature"
# Edit some files
git add <file>
git commit -m "Finish a feature"
# Develop the main branch
git checkout main
# Edit some files
git add <file>
git commit -m "Make some super-stable changes to main"
# Merge in the new-feature branch
git merge new-feature
git branch -d new-feature