Git doesn't clone all branches on subsequent clones?
branch, clone, git
Solution
See How to clone all remote branches in Git?
You need to create a local branch based on the remote branch if you actually want it to be included in a clone. However, since you don't work in remote branches anyway you'll create local branches as soon as you start working on a branch. And before that you don't really need it in your clone since you can simply fetch it from remote at any point.
However, if the notebook has no network connectivity, you'll have to create local branches for all remote branches you want so they are cloned when cloning your local repo.
If you do have network connectivity however, use `git remote add origin2 ssh://adahl@gollum//net/repos/netcube/patches.git` and then `git fetch origin2` - feel free to replace `origin2` with a more meaningful name.
Problem
I have some problems with Git using cloned repositories and branches and it's somehow not possible for me to find an answer to this. Let me describe: we have a bare master Git repository here we all pull from and push to, located on a local linux machine and reachable with ssh. I made a clone of this to my usb thumb drive like this: ``` git clone ssh://adahl@gollum//net/repos/netcube/patches.git ``` This gives me of course a local clone with a working copy on my thumb drive. I cd to this and see some branches in this clone then: ``` cd patches git branch -a * master remotes/origin/HEAD -> origin/master remotes/origin/master remotes/origin/stable ``` So far so good, however if I clone the repository on my thumb drive another time to my notebook the stable branch is lost. See: ``` cd .. git clone patches patches2 cd patches2 git branch -a * master remotes/origin/HEAD -> origin/master remotes/origin/master ``` I tried several options when cloning or a `git fetch` after cloning, nothing brings the stable branch to the patches2 repository. I assume I have a lack of understandig git here and simply use it the wrong way. Could someone please point me to my error in usage and/or understanding?