Re: [PATCH v2] git checkout -b: unparent the new branch with -o
From: Erick Mattos <hidden>
Date: 2016-06-15 22:48:25
Resending orphan branch 'cheat sheet' again. Gmail screwed it in previous email. See this using a fixed font: Branch_A | You realize that you need a new empty branch. | Is the work tree clean? | | Yes No | | git clean -ob Branch_B -------Undo?-------Was the work tree clean before? | | | | Yes No | | | | | git add . | | git commit -m temp | | | | +------+ git checkout Branch_A -f | | | git merge --squash Branch_B Do you want to use anything from the work tree? | | | git reset Yes No git branch -D Branch_B | | | git clean -df | | Change the work tree the way you want it to be. | git add . git commit | That is it!