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

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

From
Björn Steinbrink <b.steinbrink@gmx.de>
Date
Nov 12, 2009, 14:56 UTC
Message-ID
<20091112145635.GA6721@atjola.homenet>
In-Reply-To
<1258035449.26362.273.camel@heerbeest>
On 2009.11.12 15:17:29 +0100, Jan Nieuwenhuizen wrote:
Show 56 quoted lines
> Op woensdag 11-11-2009 om 21:32 uur [tijdzone +0100], schreef Tomas
> Carnecky:
> 
> Hi Tomas,
> 
> > 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.
> 
> Once I get this to work, I'll send a patch for it.
> 
> > 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.
> 
> Hmm, okay.
> 
> > 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
> 
> Ah, that makes sense.
> 
> > . 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).
> 
> Okay, so now I have
> 
>     [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
>     #	merge = refs/heads/master
>     [remote "eddy"]
> 	    url = http://github.com/epronk/gub.git
>     #use remote.eddy.fetch to +refs/heads/*:refs/remotes/eddy/*.
> 	    fetch = +refs/heads/*:refs/remotes/eddy/*
> 
> It looked promising, but still get
> 
>     15:00:20 janneke@peder:~/vc/gub
>     $ git pull -r --verbose
>     From git@github.com:janneke/gub
>      = [up to date]      lilypond-release-branch -> origin/lilypond-release-branch
>      = [up to date]      master     -> origin/master
>     Current branch master is up to date.
That used the configured defaults.
Show 5 quoted lines
>     15:00:26 janneke@peder:~/vc/gub
>     $ git pull -r --verbose eddy
>     From http://github.com/epronk/gub
>      = [up to date]      lilypond-release-branch -> eddy/lilypond-release-branch
>      = [up to date]      master     -> eddy/master
This one got arguments, so it didn't use defaults.

If you want "git pull" to use the "eddy" remote, then set branch.<name>.remote to eddy, not to origin.

And as a sidenote: Using "git pull --rebase" with more than one upstream is most of the time a very bad idea.

Let's say we have:
A---B---C---D (master)
     \   \
      \   E---F---G (origin's master)
       \
        H---I---J (eddy's master)
Now you do "git pull --rebase origin master", which results in:
                      D' (master)
                     /
A---B---C---E---F---G (origin's master)
     \
      H---I---J (eddy's master)

And then you do "git pull eddy master", which will now rebase history that is not yours:

A---B---C---E---F---G (origin's master)
     \
      H---I---J (eddy's master)
               \
                C'--E'--F'--G'--D' (master)
IOW, you get one hell of a mess.
Björn
Previous: Junio C HamanoNext: Tomas Carnecky
Message 25 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.