change the branch when the branch not shown in git branch -l

后端 未结 3 1743
南旧
南旧 2021-01-15 08:09

When I cloned a remote repository, I used the following command-

git clone -b mybranch --single-branch git://sub.domain.com/repo.git

After

3条回答
  •  情深已故
    2021-01-15 08:40

    You can list the branches directly on the remote with git ls-remote command:

    git ls-remote git://sub.domain.com/repo.git
    

    Then use git fetch command to fetch a specific branch and git checkout command to switch to the branch.

提交回复
热议问题