How do I push a new local branch to a remote Git repository and track it too?

后端 未结 15 1310
逝去的感伤
逝去的感伤 2020-11-22 09:17

I want to be able to do the following:

  1. Create a local branch based on some other (remote or local) branch (via git branch or git checkout

15条回答
  •  粉色の甜心
    2020-11-22 09:58

    To create a new branch by branching off from an existing branch

    git checkout -b 
    

    and then push this new branch to repository using

    git push -u origin 
    

    This creates and pushes all local commits to a newly created remote branch origin/

提交回复
热议问题