9
I was reading the Git documentation about pull and I got confused:
So let’s create a hypothetical sequence:
- I cloned the repository
- I made a
git branch
which 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 the local branch develop. So I do
git checkout -b develop origin/develop
. Here is my question. When we dogit checkout -b develop origin/develop
are we pulling the remote develop arm or are we enabling locally a develop arm that was pulled at the time of the clone? Watching this part of the git pull documentation, It seems to me that it is the second scenario, because this is the justification of thegit pull
before making apull 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
I mean, it’s like the git pull origin
, will pull from a local arm that is origin/develop but is not the develop that is in the central repository.
So that’s why we have to make one git pull
to update all local images with remote content and then pull origin develop to update my develop local with origin/develop which is local tbm.
It confuses me because from within my branch develop git branch -vv
show 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 wouldn’t need to do git pull
(as the documentation suggests) before making git pull origin
, unless I wanted to update all local branches ("hidden"). And if that were the case, if git pull updated everything, I wouldn’t have to git pull origin
from inside my develop.
So actually, where is it pulling (or updating data) when I do git pull?
The
git pull
makes agit fetch
followed by agit merge
. When you specify which remote, then it does not take from the default to that branch, but from the equivalent branch of the past remote.– Jefferson Quesado