From: Erick Mattos Date: Sun, 14 Mar 2010 21:58:07 GMT Subject: Re: [PATCH v2] git checkout -b: unparent the new branch with -o Message-ID: <55bacdd31003141458y3dfa3734i664b61e69dd50436@mail.gmail.com> In-Reply-To: <55bacdd31003141346t408c276ak507b7c289cf17679@mail.gmail.com> 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!