it only pulls the files from the master branch, and not ALL the branches
The rules for pull
are somewhat configuration-dependent, but I can tell you that when you clone
it is getting the entire history (all branches) unless you give it specific options telling it not to (such as --single-branch
).
I know this because when I run git branch I only see the master branch
That's because by default git branch
lists the local branches, and not every known branch from the remote(s). You can say
git branch -a
to see the rest. They'll appear with names like
remotes/origin/branch-name
because what you have are not proper branches; rather these are sort of "bookmarks" that tell you where the remotes branches were, when last you fetched from the remote.
By default, cloning does not automatically create local branches for every branch on the remote (but it does fetch the branches). By default cloning does check out the default branch from the remote (master
in this case), creating the local branch for it. And there are shortcuts built in to git such that, in a typical configuration with a single remote, you can say
git checkout branch-name
to create the local branch corresponding to the remote's branch-name
branch.
Note that when you do this initial checkout, you don't want to say
git checkout remotes/origin/branch-name
because that does something else. Rather than create the local branch, this simply puts you in "detached HEAD
" state, with HEAD
on the same commit as the remote branch.