Clone is not getting all my branches from GitHub
I followed the instructions here to create a GitHub Pages-hosted blog using Octopress.
After the first deployment, two branches got created on GitHub:
- Octopress blog deploying error 'rake aborted! No such file or directory - git remote -v'
- Git commit ERROR: Repository invalid
- how do I check in something that is a submodule?
- Git workflow with Octopress on Heroku
- fatal: could not open '.git/COMMIT_EDITMSG': Permission denied
- What do I have to push to github to update my octopress blog?
Then I ran
git branch and I noticed I only have one of the two branches locally. I ran
git pull, expecting Git to download my other branch as well, but it instead merged the two branches.
I deleted my local repo and then did a git clone, expecting to get the two branches locally, but I Git only downloaded the
master branch of my Weblog.
Any ideas what have I done wrong and how can I get my two branches locally?
Thanks for the answers. Just for sake of completeness, here’s what I ended up doing:
git clone <github URL> -b source myblog cd myblog git clone <github URL> -b master _deploy
And then it was possible to continue with writing new posts, and deploying via
2 Solutions collect form web for “Clone is not getting all my branches from GitHub”
Seems like nothing is wrong, actually. Your
source branch should contain Octopress, so once you did
git checkout source, you should be able to create your posts and then use corresponding
rake tasks in order to generate static files, stage/commit/push them to the master branch on origin, which will make your posts accessible on Github Pages.
There is a big difference between local branches and remote branches. A git clone will fetch all information from the origin/remote. And will checkout (create the local branch, which tracks its corresponding remote branch, and checks out the working files) the default branch of the repository. Technically you should have
origin/source branches in your cloned branch..but
git branch only shows your local branch(es):
git branch -a to show all branches (local and remote). Run a
git checkout source, which will create a local branch based off of the remote branch.