How do I fetch back all the branches for my repository on Git?
I tried the following:
git remote add origin git@github.com:anchetaWern/Zenoir-Online-Classroom.git
git pull git@github.com:anchetaWern/Zenoir-Online-Classroom.git
I have 3 branches in that repository but now I only have the master branch. How do I pull back the other 2?
After you do the ‘git remote add origin the-repo’ just perform a ‘git fetch -a origin’ at which point all the branches are there and ready to be checked out. Here is a typical workflow:
So, for this example, branch ‘add-on’ is now in the working directory and ‘git checkout master’ will get files from the remote ‘origin’ if needed.