From: Junio C Hamano Date: Mon, 12 Aug 2013 17:24:46 GMT Subject: Re: ephemeral-branches instead of detached-head? Message-ID: <7vk3jqzush.fsf@alter.siamese.dyndns.org> In-Reply-To: Duy Nguyen writes: > On Mon, Aug 12, 2013 at 7:14 PM, David Jeske wrote: >> IMO, the current warning during checkout of a detached-head is >> misplaced. It should be removed, and instead there should only be a >> warning after detached-head commit, since this is the only time there >> is a danger of losing something. > > That would annoy me as I often work on top of detached HEAD on purpose > and only create a branch when I want to save something. If the warning > is to be moved, it should warn at the next checkout. Don't we already do that? Warning: you are leaving N commits behind, not connected to any of your branches: ... list of commits to be lost ... If you want to keep them by creating a new branch, this may be a good time to do so with: git branch new_branch_name xxxxxx Switched to branch 'master'