Where does Git pull point?


I was reading the Git documentation on pull and I ended up getting confused:

So let's create a hypothetical sequence:

  • I've cloned the repository
  • I made a git branch that shows only the master.
  • The command git branch -a shows my local branch (which is the master) and the other remote.
  • I want to have branch develop locally. Then I git checkout -b develop origin/develop . Here is my question. When we do git checkout -b develop origin/develop are we pulling the remote develop arm or are we locally enabling a develop arm that was pulled at the time of the clone? Looking at this part of the git pull documentation , it seems to me that it is the second scenario, as this is the justification for git pull before making a pull da origin .

    Update the remote-tracking branches for the repository you cloned from, then merge one of them into your current branch:

    $ git pull
    $ git pull origin
  • That is, it looks like git pull origin , will pull from a local arm that is origin / develop but that is not the develop that is in the central repository.

    So we have to make a git pull to update all the local images with the remote content and then do the pull origin develop to update my develop local with the origin / develop that is local tbm.

    This makes me confused because from within my branch develop git branch -vv shows me:


    develop bbfdft67 [origin / develop] ZF45: Modifications in the tables   and chart in FAQs - Take 3,

    So if my develop points to [origin / develop] I would not have to do git pull (as documentation suggests) before doing git pull origin , unless I wanted to update all local branches ("hidden" ). And if that were the case, if git pull updated everything, I would not have to git pull origin from within my develop.

    So, really, where are you pulling (or updating data) when I do git pull?

    asked by anonymous 29.08.2017 / 20:22

    2 answers


    execute a git remote -v that it will show the association where the data comes from.

    origin is a nickname that git gives to a remote repository when it is cloned.

    05.09.2017 / 21:00

    When we do git checkout -b develop origin / develop are we pulling the develop remote arm or are we locally enabling a develop arm that was pulled at the time of the clone?

    When you checkout -b you are creating a branch locally, the secret of the workflow is in the push from that local branch, which should be done with:

    git push --set-upstream origin develop

    I give a complete example of local branch creation link

    31.07.2018 / 03:19