Ian Zimmerman wrote: > Jonathan> Confusingly enough, this stuff is documented in git-pull(1) > Jonathan> but not git-fetch(1)! > >> Default values for <repository> and <branch> are read from the >> "remote" and "merge" configuration for the current branch as set by >> git-branch --track. > > I have never executed git branch --track. [...] > The file currently looks like this: > > [core] > repositoryformatversion = 0 > filemode = true > bare = false > logallrefupdates = true > [remote "origin"] > fetch = refs/heads/*:refs/remotes/origin/* > url = http://www.red-bean.com/decklin/mnemosyne.git > [remote "myserver"] > url = ssh://myserver.homeip.net/var/local/git/mnemosyne.git
Thanks. What the paragraph in git-pull(1) is clumsily trying to say is that the default for <repository> comes from the [branch "master"] remote = origin setting if you have it. The [branch "master"] stanza contains configuration for the current branch. If the 'remote' setting there is missing, the default is "origin". The default collection of refs to fetch comes from: 1) the "fetch" lines for the remote being fetched, if any 2) otherwise, if we are fetching from the same remote as the current branch pulls from, the refs listed in branch.<current>.merge configuration, if any 3) otherwise, the remote HEAD, so you can do git fetch git://some/repo/or/other without configuring a remote to peek at what's in their default branch. "git pull" fetches following the same rules. So in particular if no refspec is provided on the command line, then everything listed in the fetch line for that remote will be fetched, just like "git fetch" would do. Among the fetched branches, the subset to incorporate into the current branch comes from [branch "master"] merge = refs/heads/master If that configuration item is absent, there is an error message: There is no tracking information for the current branch. Please specify which branch you want to merge with. [...] > I think at least 2 structural improvements > are needed: > > 1. Explain the relationship between the configuration files and commands > like git branch --track. Yes, I think it would be useful to have a page describing what it means for a local branch to have a corresponding upstream branch, what commands use and affect that setting, and how it is recorded. Perhaps a new section in the git-branch(1) page would do the trick. > 2. Document the default for each option/argument _in the manpage > paragraph for that option_. So, for this example: do you think the DESCRIPTION section of git-fetch(1) should be reorganized like git-checkout(1) to describe each form of the command separately? git fetch <repository> <refspec> git fetch --multiple (<repository | <group>)..., git fetch <repository> | <group>, git fetch git fetch --all Then in the description of each form, the meaning of each argument could be discussed thoroughly, with pointers to documentation elsewhere where appropriate. [...] > I am currently sick. When back in form I may try to write something up Thanks, sounds good. If you have any questions, please don't hesitate to ask. Hope that helps, Jonathan -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org