Clone from a branch other than master

前端 未结 4 665
不思量自难忘°
不思量自难忘° 2021-01-30 03:20

I am trying to pull from a repository in Github. But I don\'t want to clone the master branch. I want to clone some other branch. When I try git clone ,

4条回答
  •  隐瞒了意图╮
    2021-01-30 03:36

    Try this:

    git init
    git fetch url-to-repo branchname:refs/remotes/origin/branchname
    

    EDIT

    A better solution:

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

提交回复
热议问题