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

Re: strange "git clone" behavior wrt an active branch

From
SBSanti Béjar <santi@agolina.net>
Date
Sep 28, 2008, 19:43 UTC
Message-ID
<adf1fd3d0809281243x24974ddfk3fd6ce2667ac2edc@mail.gmail.com>
In-Reply-To
<ee2a733e0809280623i30a9e298i30db2a84b8530d61@mail.gmail.com>
On Sun, Sep 28, 2008 at 3:23 PM, Leo Razoumov <slonik.az@gmail.com> wrote:
Show 22 quoted lines
> On 9/28/08, Santi Béjar <santi@agolina.net> wrote:
>> On Sun, Sep 28, 2008 at 2:05 PM, Leo Razoumov <slonik.az@gmail.com> wrote:
>>  > Hi All,
>>  > I am using the latest stable version git-1.6.0.2.
>>  >
>>  > The man page for git-clone states explicitly that "git clone"
>>  >
>>  > " Clones a repository into a newly created directory, ...[snip]...
>>  >  and creates and checks out an initial branch equal to the
>>  >  cloned repository's currently active branch. "
>>  >
>>  > I noticed that while my active branch "My" happens to point to the
>>  > same commit as the "master" the git clone will check out master
>>  > instead of My (currently active branch). Is it a bug?
>>  >
>>
>>
>> Currently it is only guessed which is the active branch (with a
>>  preference for the master branch as it is the default), as the current
>>  protocol does not allow transferring the ref links:
>
> This is quite unfortunate design decision.

This is not a design decision, git has evolved, not designed. The ref links are younger than the transfer protocols.

> There can be any number of
> local branches referring to the same commit. Without being able to
> pick into .git/HEAD it is impossible to decide which of them is
> "active".
I'm sure patches are welcome.
>
> --Leo--
>
Previous: Leo Razoumov
Message 4 of 4 in “strange "git clone" behavior wrt an active branch”
  1. Leo RazoumovSep 28, 2008
  2. Santi BéjarSep 28, 2008
  3. Leo RazoumovSep 28, 2008
  4. Santi BéjarSep 28, 2008

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.