I have a master
and a development
branch, both pushed to GitHub. I\'ve clone
d, pull
ed, and fetch
ed, but I re
git clone
downloads all remote branches but still considers them "remote", even though the files are located in your new repository. There's one exception to this, which is that the cloning process creates a local branch called "master" from the remote branch called "master". By default, git branch
only shows local branches, which is why you only see "master".
git branch -a
shows all branches, including remote branches.
If you actually want to work on a branch, you'll probably want a "local" version of it. To simply create local branches from remote branches (without checking them out and thereby changing the contents of your working directory), you can do that like this:
git branch branchone origin/branchone
git branch branchtwo origin/branchtwo
git branch branchthree origin/branchthree
In this example, branchone
is the name of a local branch you're creating based on origin/branchone
; if you instead want to create local branches with different names, you can do this:
git branch localbranchname origin/branchone
Once you've created a local branch, you can see it with git branch
(remember, you don't need -a
to see local branches).