Re: [PATCH] Proof-of-concept patch to remember what the detached HEAD was
- From
Jay Soffian <jaysoffian@gmail.com>
- Date
- Oct 14, 2009, 18:56 UTC
- Message-ID
- <76718490910141156g440ee455t2e1db72ad72b7049@mail.gmail.com>
- In-Reply-To
- <alpine.LNX.2.00.0910140037570.32515@iabervon.org>
On Wed, Oct 14, 2009 at 12:44 AM, Daniel Barkalow <barkalow@iabervon.org> wrote:
Show 12 quoted lines
> $ git commit > You've been sightseeing "origin/master". The commit can't change that > value, so your commit isn't held in any branch. If you want to create > a branch to hold it, here's how. > > "git checkout origin/master" should be similar in complexity to > "svn checkout -r 8655"; the difference is that svn won't let you > commit then and git will but you'll need to understand the > implications if you do so. If you don't commit (because you don't want > to make any changes, because you don't think it would be possible, or > because you don't want to worry about what would happen), there's no > meaningful difference, and you don't need to be told.
Huh, I hadn't seen this message before I wrote in a reply to "builtin-checkout: suggest creating local branch" that we do the following at commit, which I think is what you're suggesting:
$ git commit -m "blah" Cannot commit while not on any branch. Please use git commit -b <branch> to specify the name of a new branch to commit to, or use git commit -f to force a detached commit.
I'm not sure that requires the complexity of remembering how the user got detached though?
j.