News for hackers. Stuff that matters.
Re:A List Apart: Get started with Git by eru on Tuesday November 02, 2010 @07:39PM (#1862916)
>> It's very easy to find yourself on no branch at all > Interesting. In what situation would that happen? I always thought you had to be on some sort of branch (master) at least to use git.

If you check out a revision, and not a branch, you will be on "no branch at all". But you asked for it, then.

Re:A List Apart: Get started with Git by jrockway on Tuesday November 02, 2010 @07:52PM (#1862947)
And of course, you can still commit there and give it a name later. Hack, then cleanup. That's the git model.
Re:A List Apart: Get started with Git by IdahoEv on Thursday November 04, 2010 @05:46PM (#1870946)
I figured this out eventually. However, when I first switched to git (and before I had tools to show my branch in my prompt), I managed more than once to make 3-4 commits on a detached head, and finding out how to fix that between the documentation and/or Google was essentially impossible. Once I simply gave up and re-did the work. The other time I figured out how to fix it, at the cost of about 3 hours of research and (eventually) questions on the IRC channel.

It's a powerful tool, and the docs are fine if you are an expert who already knows what you're looking for. I'll submit that it can be incredibly hard for a noob to learn to use correctly.

Re:A List Apart: Get started with Git by eru on Tuesday November 02, 2010 @09:06PM (#1863149)
Just don't do a GC, while you have dangling commits.
Re:A List Apart: Get started with Git by jrockway on Tuesday November 02, 2010 @09:33PM (#1863226)
You're fine as long as the detached head is newer than two weeks old. (And you might be fine past that point. While the branch is "unnamed" it does have a ref in the reflog pointing at it.)