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

后端 未结 15 1583
逝去的感伤
逝去的感伤 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 10:11

    Simply put, to create a new local branch, do:

    git branch 
    

    To push it to the remote repository, do:

    git push -u origin 
    

提交回复
热议问题