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

Re: Unhelpful "branch.master.remote = <nickname>" advice?

From
Tomas Carnecky <tom@dbservice.com>
Date
Nov 11, 2009, 20:32 UTC
Message-ID
<AC99BA30-A36D-4798-8E7D-9D69EFE99D55@dbservice.com>
In-Reply-To
<1257968052.26362.155.camel@heerbeest>
On Nov 11, 2009, at 8:34 PM, Jan Nieuwenhuizen wrote:
Show 13 quoted lines
> Op woensdag 11-11-2009 om 20:10 uur [tijdzone +0100], schreef Tomas
> Carnecky:
>> On Nov 11, 2009, at 7:56 PM, Jan Nieuwenhuizen wrote:
>
> Hi Tomas,
>
>> You used this:
>> $ git config branch.master.remote = <something>
>> Do you see the difference between that and what I posted?
>
> Sure, I now know what syntax you and the advise mean.  However,
> I'm just pointing out that the git pull advise makes no sense,
> however way you try to interpret it?

It didn't tell you to copy'n'paste the whole lines to a git-config(1) commandline. But I do see that the output can be confusing for someone not familiar with the git configuration files/git-config.

Show 15 quoted lines
>>> I think it might be more helpful if this text said
>>> configuration file and gave a usable configuration file
>>> snippet, or alternatively said git config, and gave usable
>>> git config commands.
>>
>> Feel free to send a patch ;)
>
> [just maybe, if my uninstall patch goes in easily, but]
>
> First I need to know what the new advise should be.  As you
> can see below, I'm still confused.
>
> I was hoping someone would say: Ah blast!  That was me,
> stupid: Fixed in master :-)  And everything would make
> sense and work.
You can use git-blame(1) to find out who wrote those lines ;)
Show 23 quoted lines
>
>> branch.master.remote has two different values, git doesn't know which
>> remote to use.
>
> Well, it can see that there already is a value for  
> branch.master.remote
> defined, and it /still/ advises to add one.  It also uses <nickname>,
> which suggests there could be multiple values?
>
> For all I know, pull can only handle one nickname and it shouldn't
> give this advise at all?
>
>> Do you want to pull from origin or eddy?
>
> I'm publishing on origin -- that's what the original clone was
> from.  Also, I use it to update from most often, when I work
> from different locations.  All fine.
>
> Now this Eddy guy says: pull from here.  I try it and get
> this advise.  So, I'd like to have
>
>   git pull  # use origin by default
>   git pull eddy # pull from eddy's url

I don't know the relationship between you and eddy, but usually you shouldn't rebase (=rewrite) eddies commits. That also means you'd have to live with the merge commits.

Show 24 quoted lines
>
>> I would
>> recommend only keeping one [branch "master"] section and edit it
>> appropriately.
>
> Yes, I tried that and came up with
>
>    [branch "master"]
> 	    remote = origin
> 	    merge = refs/heads/master
>    [remote "origin"]
> 	    url = git@github.com:janneke/gub.git
> 	    fetch = +refs/heads/*:refs/remotes/origin/*
>    # advise from git pull, using <nickname> = eddy
>    #        branch.master.remote = <nickname>
>    #        branch.master.merge = <remote-ref>
>    #        remote.<nickname>.url = <url>
>    #        remote.<nickname>.fetch = <refspec>
>    #[branch "master"]
>    #	remote = eddy # ignore branch.master.remote advise
>    #	merge = refs/heads/master
>    [remote "eddy"]
> 	    url = http://github.com/epronk/gub.git
> 	    fetch = +refs/heads/*:refs/remotes/origin/*

I see your mistake. Both the origin and eddy remote write to the same namespace (refs/remotes/origin/*), and that's also why you get (force update) below

. Change the fetch line of remote.eddy.fetch to +refs/heads/*:refs/ remotes/eddy/*. After that both command (pull -r / pull -r eddy) should work (I hope).

Show 48 quoted lines
>
> This /seems/ to work.  However, I still get this
>
>    $ git pull -r
>    From git@github.com:janneke/gub
>     + 7bb5905...8ff38da master     -> origin/master  (forced update)
>    First, rewinding head to replay your work on top of it...
>    Fast-forwarded master to 8ff38da0a7013a891de18a0b7bec12b9d1fa6637.
>    20:25:55 janneke@peder:~/vc/gub
>
> [looks okay]
>
>    $ git pull -r eddy
>    From http://github.com/epronk/gub
>     + 8ff38da...7bb5905 master     -> origin/master  (forced update)
> [looks fine too, but still continues with]
>    You asked me to pull without telling me which branch you
>    want to merge with, and 'branch.master.merge' in
>    your configuration file does not tell me either.	Please
>    specify which branch you want to merge on the command line and
>    try again (e.g. 'git pull <repository> <refspec>').
>    See git-pull(1) for details.
>
>    If you often merge with the same branch, you may want to
>    configure the following variables in your configuration
>    file:
>
> 	branch.master.remote = <nickname>
> 	branch.master.merge = <remote-ref>
> 	remote.<nickname>.url = <url>
> 	remote.<nickname>.fetch = <refspec>
>
>    See git-config(1) for details.
>    [1]20:26:01 janneke@peder:~/vc/gub
>    $
>
> so I'm still missing something?
>
>> Is 'git pull -r' not short enough for you?
>
> It's more of a usability thing.  It annoys me that the most
> used functionality needs a command line option.  Worse however,
> is that people [myself included] tend to forget that "-r",
> and our logs have lots of these ugly, unnecessary
>
>    c377994 Merge branch 'master' of ssh+git://git.sv.gnu.org/srv/git/lilypond
>
> Also, we need to explain this to all newcomers.

I've found that all the available guides and books about git explain merging pretty well (it's a central part of git after all).

tom
Previous: Jan NieuwenhuizenNext: Jan Nieuwenhuizen
Message 9 of 26 in “Unhelpful "branch.master.remote = <nickname>" advice?”
  1. Jan NieuwenhuizenNov 11, 2009
  2. Tomas CarneckyNov 11, 2009
  3. Makefile: add uninstall target. Fixes elementary good cleaning manners.Jan Nieuwenhuizen, Nov 18, 2009
  4. Matthieu MoyNov 18, 2009
  5. Jan KrügerNov 11, 2009
  6. Junio C HamanoNov 11, 2009
  7. Tomas CarneckyNov 11, 2009
  8. Jan NieuwenhuizenNov 11, 2009
  9. Tomas CarneckyNov 11, 2009
  10. Jan NieuwenhuizenNov 12, 2009
  11. git-pull.sh: overhaul error handling when no candidates are foundJan Krüger, Nov 12, 2009
  12. Jeff KingNov 12, 2009
  13. Jan KrügerNov 12, 2009
  14. Jeff KingNov 12, 2009
  15. git-pull.sh --rebase: overhaul error handling when no candidates are foundJan Krüger, Nov 12, 2009
  16. Jonathan NiederNov 13, 2009
  17. pull: clarify advice for the unconfigured error caseJonathan Nieder, Nov 27, 2009
  18. Junio C HamanoDec 2, 2009
  19. Jonathan NiederDec 3, 2009
  20. Jeff KingDec 3, 2009
  21. Jan NieuwenhuizenDec 3, 2009
  22. Jan KrügerDec 3, 2009
  23. Junio C HamanoDec 7, 2009
  24. Junio C HamanoNov 15, 2009
  25. Björn SteinbrinkNov 12, 2009
  26. Tomas CarneckyNov 12, 2009

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.