How to create a branch in a bare repository in Git

后端 未结 3 1928
眼角桃花
眼角桃花 2021-02-04 00:55

I current have a bare repo thats acts as a central repo for my team. The bare repo currently only have a branch \"master\". How can I create more branches on the bare repo?

3条回答
  •  一个人的身影
    2021-02-04 01:09

    To create a new branch (locally) called branchname

    git branch branchname
    

    Then to sync it with the remote repository like GitHub (if applicable)

    git push origin branchname
    

    And to use it for development / make the branch the active branch

    git checkout branchname
    

提交回复
热议问题