Re:Legit. Git for humans
by djacobs on Sunday March 25, 2012 @09:01PM
(#3754443)
Is there a case when it's not a simple git reset my-file away?
[ Parent
| on HN ]
Yes there is. When you have a new repository without any commits, there is no HEAD, so you can't unstage by resetting.
mkdir try
cd try
git init
touch file
git add file
git status
Still, the git status command shows you what you need to do to unstage.Indeed no. That's exactly what git reset does: "copy entries from <commit> to the index". I got that from the unusably bad man page. It was the first sentence.
My question was a rhetorical one :)
I know. But you were needlessly agreeable. I thought some salt needed to be rubbed into the GP post.
And in every git status message.