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

[BUG] git show <remote>: bad information: Local branch|ref configured

From
SRSeth Robertson <in-gitvger@baka.org>
Date
Nov 13, 2010, 00:41 UTC
Message-ID
<201011130041.oAD0fdmM017083@no.baka.org>

Over in #git we ran into a user wondering why a particular remote said something about "master pushes to master" when the local branch mapped to that remote was not named master.

Not having inspected the code, it certainly appears as if the "Local branch configured" and "Local ref configured" information is only accidentally correct, but since the normal configuration is the case in which it is accurate, no-one noticed the problem.

In the test case below, in the "bar" case we are missing the "Local ref configured for 'git push'" section entirely. Strange since git push does indeed work.

In the "baz" case we see the message and master does push to master.

In the "biff" case we see the confluence of the two previous cases. The "foo" remote/subcase shows what we might expect, but the "baz" remote/subcase shows the 'Local ref configured' information is a lie. Finally, the "bar" remote/subcase shows that even the "Local branch configured" information is somehow magic based on the remote branch being named master.

This test was done using git 1.7.3.1

Test case prep ---------------------------------------------------------------------- mkdir foo; cd foo; git init; echo A>A; git add A; git commit -m A; git checkout -b other; echo B>B; git add B; git commit -m B; git checkout master

mkdir ../bar; cd ../bar; git init; git remote add foo ../foo; git fetch foo; git checkout --track -b foo_master foo/other

mkdir ../baz; cd ../baz; git init; git remote add foo ../foo; git fetch foo; git checkout --track -b master foo/master

mkdir ../biff; cd ../biff; git init; git remote add foo ../foo; git fetch foo; git checkout --track -b master foo/master; git remote add baz ../baz; git fetch baz; git checkout --track -b baz_master baz/master git remote add bar ../bar; git fetch bar; git checkout --track -b bar_master bar/master ----------------------------------------------------------------------

cd ../bar; git remote show foo
 --------------------------------------------------
 * remote foo
   Fetch URL: ../foo
   Push  URL: ../foo
   HEAD branch: master
   Remote branches:
     master tracked
     other  tracked
   Local branch configured for 'git pull':
     foo_master merges with remote other
 --------------------------------------------------
cd ../baz; git remote show foo
 --------------------------------------------------
 * remote foo
   Fetch URL: ../foo
   Push  URL: ../foo
   HEAD branch: master
   Remote branches:
     master tracked
     other  tracked
   Local branch configured for 'git pull':
     master merges with remote master
   Local ref configured for 'git push':
     master pushes to master (up to date)
 --------------------------------------------------
cd ../biff; git remote show foo; git remote show baz; git remote show bar
 --------------------------------------------------
 * remote foo
   Fetch URL: ../foo
   Push  URL: ../foo
   HEAD branch: master
   Remote branches:
     master tracked
     other  tracked
   Local branch configured for 'git pull':
     master merges with remote master
   Local ref configured for 'git push':
     master pushes to master (up to date)
 * remote baz
   Fetch URL: ../baz
   Push  URL: ../baz
   HEAD branch: master
   Remote branch:
     master tracked
   Local branch configured for 'git pull':
     baz_master merges with remote master
   Local ref configured for 'git push':
     master pushes to master (up to date)
 * remote bar
   Fetch URL: ../bar
   Push  URL: ../bar
   HEAD branch: foo_master
   Remote branch:
     foo_master tracked
 --------------------------------------------------
					-Seth Robertson
Next: Jonathan Nieder
Message 1 of 4 in “[BUG] git show <remote>: bad information: Local branch|ref configured”
  1. Seth RobertsonNov 13, 2010
  2. Jonathan NiederNov 13, 2010
  3. Seth RobertsonNov 13, 2010
  4. Jonathan NiederNov 13, 2010

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.