Re: Bootstrapping into git, commit gripes at me
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- Jul 11, 2005, 23:45 UTC
- Message-ID
- <Pine.LNX.4.58.0507111636030.17536@g5.osdl.org>
- In-Reply-To
- <20050711222046.GA21376@buici.com>
On Mon, 11 Jul 2005, Marc Singer wrote:
Show 8 quoted lines
> > I picked 2.6.12 > > # git checkout -f v2.6.12 > > applied the patch and was greeted with an error about being unable to > commit telling me that I LONG_HEX_NUMBER is not a valid commit object. > Isn't 2.6.12 later than 2.6.12-rcX?
Yes.
However, that's not how "git checkout" ends up working, which is probably (almost certainly) a misfeature of git checkout. In particular, when you use a tag to checkout something, it will checkout the _state_ at that point (ie v2.6.12), but it won't have reset your HEAD to point to it.
And your earlier adventures made your HEAD be something that isn't a commit (although I quite frankly don't know quite how you succeeded at that: "git checkout" should refuse to write a HEAD unless you check out a specific branch, and all branch pointers are proper commit points).
Anyway, here's how you fix it right now, and I'll have to figure out how to make a nice interface:
# # Reset the "master" branch to v2.6.12 # git-rev-list --max-count=1 v2.6.12 > .git/refs/heads/master
# # Switch to the master branch # git checkout -f master
which should get you to be at a known point (which is v2.6.12).
Linus