git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Is there a way to fetch commits that are detached

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 24, 2012, 22:15 UTC
Message-ID
<xmqq62cog4iz.fsf@junio.mtv.corp.google.com>
In-Reply-To
<CA+jCPNcmcxQcSN_BNvigQa2uRiaw-c2PK5T-y1yacYNs6Ws4WA@mail.gmail.com>
Allan Caffee <allan.caffee@gmail.com> writes:
> Is there a way to explicitly fetch whatever objects are necessary to checkout
> the commit?

One security principle built into git is that any object that is unreachable from refs/* is not to be exposed to outside world. If the commit is not on any ref, you shouldn't be able to obtain it remotely.

So you need to know which branch (or it could be a tag) the commit you want is on, fetch that branch or tag and then check the commit out.

Previous: Allan Caffee
Message 2 of 2 in “Is there a way to fetch commits that are detached”
  1. Allan CaffeeApr 24, 2012
  2. Junio C HamanoApr 24, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.