[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