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

Git-pull Documentation

From
MRMaris Razvan <razvan.alex.maris@gmail.com>
Date
Feb 13, 2019, 18:13 UTC
Message-ID
<CALZbgSSzpd7bDWE1iyfqAsv9oovsSK22oReDiPGG-Td5D2qgaA@mail.gmail.com>
Hello,

In the "EXAMPLES" section of the git-pull documentation (https://git-scm.com/docs/git-pull#_examples) there is the following:

    "[...] Merge into the current branch the remote branch next:
    $ git pull origin next
    This leaves a copy of next temporarily in FETCH_HEAD, but does not
update any remote-
    tracking branches. [...]"

However, the second bullet-point in the "CONFIGURED REMOTE-TRACKING BRANCHES" section of the git-fetch documentation (https://git-scm.com/docs/git-fetch#_configured_remote_tracking_branches_a_id_crtb_a) states that it is possible for a command of the form "git fetch <remote> <branch>" to update a remote-tracking branch.

I checked and the current behaviour of "git pull <remote> <branch>" is to update the remote-tracking branch if required, because, as I have seen in the code, it just calls "git fetch".

I believe that the quoted example from the git-pull documentation is wrong.

Also, in the beginning of the git-pull documentation there is the following paragraph:

    "Default values for <repository> and <branch> are read from the
"remote" and "merge"
    configuration for the current branch as set by git-branch[1] --track."

I believe that this paragraph tries to state that if the <remote> and the <refspec> arguments are missing, they are replaced with branch.<name>.remote and branch.<name>.merge, respectively. However I think that this paragraph is unnecessary (and partially wrong), as the behaviour of git-pull when no arguments are given is described in the "DEFAULT BEHAVIOUR" section (https://git-scm.com/docs/git-pull#_default_behaviour) and it is a little more complicated than that, as one set of branches are used for fetching (e.g. the values of remote.<origin>.fetch) and another set of branches are used for merging (e.g. the value of branch.<name>.merge).

I hope I did not miss anything.

Thank you, Razvan Maris

Next: Junio C Hamano
Message 1 of 2 in “Git-pull Documentation”
  1. Maris RazvanFeb 13, 2019
  2. Junio C HamanoFeb 13, 2019

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.