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

default remote branch

From
Thibault Kruse <tibokruse@googlemail.com>
Date
Sep 18, 2015, 09:50 UTC
Message-ID
<CAByu6UUxsWu5RVar=8uKJw3kZpxjawqbwABgNREjJ3g3mGDwVA@mail.gmail.com>
Hi,

the 'git remote show <remote>' command shows the default branch among other things. The default branch being the branch that a clone will have immediately after cloning.

Is it possible to run a command that only shows that default branch for a given remote?

Also, I tried finding out whether I can use the .git/refs/remotes/<remote>/HEAD to check the default branch without accessing the remote. However, I find this file is not updated with a git fetch, nor created when missing.

So is there a sane way to get the last know default branch without accessing the remote? If so, is there a way to update local information about the default branch of a remote?

cheers,
  Thibault
Next: Junio C Hamano
Message 1 of 2 in “default remote branch”
  1. Thibault KruseSep 18, 2015
  2. Junio C HamanoSep 21, 2015

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.