Git doesn't clone all branches on subsequent clones?

前端 未结 4 1743
攒了一身酷
攒了一身酷 2020-12-06 07:54

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

4条回答
  •  醉梦人生
    2020-12-06 08:21

    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.

提交回复
热议问题