From what I understand, whenever you run git fetch
remote objects are downloaded locally and a lightweight pointer named FETCH_HEAD
to the HEAD
commit of the remote branch is created.
Since a branch is simply a pointer, how is this different from creating a local branch? What design considerations support the case for not creating a local branch whenever using git fetch
?
Check out this entry What does FETCH_HEAD in Git mean? .
Since a branch is simply a pointer, how is this different from creating a local branch? What design considerations support the case for not creating a local branch whenever using git fetch?
Because git fetch
is meant to repatriate the state of known remote branches and associated missing objects. This is different from having an homolog local branch that, in this case, would probably be configured to track its remote homolog.
Branches are very often configured to automatically create that local branches, indeed, but only once you check them out first with git checkout
.