Re: Cloning a remote tag without using git-fetch-pack directly?
- From
Jeff King <peff@peff.net>
- Date
- Apr 20, 2011, 07:38 UTC
- Message-ID
- <20110420073805.GA2285@sigill.intra.peff.net>
- In-Reply-To
- <20110420072720.GC1790@feather>
On Wed, Apr 20, 2011 at 12:27:20AM -0700, Josh Triplett wrote:
Show 8 quoted lines
> Sadly, though, I still can't check out the result: > > /tmp/linux-2.6$ git checkout FETCH_HEAD > fatal: Cannot switch branch to a non-commit. > (128) /tmp/linux-2.6$ git checkout -b master FETCH_HEAD > fatal: Cannot switch branch to a non-commit. > > I guess I'd hoped for something similar to "detached HEAD" mode.
No, it wouldn't make any sense to have a non-commit in HEAD, detached or otherwise, since you couldn't build commits on top of it (what would the new commit's parent pointer have in it?).
If you just want to check the files out into the working tree, you can do:
git read-tree --reset -u FETCH_HEAD
But I'm not really clear on what you're trying to accomplish with all of this. If you can describe your ultimate goal, I might be able to help more.
-Peff