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

[BUG] remote.pushdefault and branch.<name>.pushremote definition order

From
Jack Nagel <jacknagel@gmail.com>
Date
Feb 24, 2014, 05:10 UTC
Message-ID
<CAMYxyaUwPXXdvGv786_p5n7-biMLOFbur-gQ1pxXOttc0R0=eg@mail.gmail.com>

There seems to be a difference in the behavior of "git push" depending on whether remote.pushdefault is defined before or after branch.<name>.pushremote in .git/config.

If remote.pushdefault is defined to be "origin", and later in the file, branch.master.pushremote is defined to be "upstream", then a plain "git push" from master errors out because I haven't provided a refspec or configured push.default. This makes sense.

However, if the order of the two in the file is reversed, then a plain "git push" pushes to the "origin" repository, even though I have set the pushremote for master to "upstream". This appears to be a bug.

I would expect the order that things are defined in the config file to have no effect on the behavior of "git push".

I have reproduced this using git 1.9.0 and 1.8.3.4.

Thanks, Jack

Next: Jeff King
Message 1 of 7 in “[BUG] remote.pushdefault and branch.<name>.pushremote definition order”
  1. Jack NagelFeb 24, 2014
  2. remote: handle pushremote config in any order orderJeff King, Feb 24, 2014
  3. Junio C HamanoFeb 24, 2014
  4. Junio C HamanoFeb 24, 2014
  5. Jeff KingFeb 24, 2014
  6. Junio C HamanoFeb 24, 2014
  7. Ramkumar RamachandraFeb 24, 2014

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.