How do you create a remote Git branch?

后端 未结 23 1914
感情败类
感情败类 2020-11-22 13:31

I created a local branch which I want to \'push\' upstream. There is a similar question here on Stack Overflow on how to track a newly created remote branch.

Howeve

23条回答
  •  情歌与酒
    2020-11-22 14:05

    [Quick Answer]

    You can do it in 2 steps:

    1. Use the checkout for create the local branch:

    git checkout -b yourBranchName
    

    2. Use the push command to autocreate the branch and send the code to the remote repository:

    git push -u origin yourBranchName
    

    There are multiple ways to do this but I think that this way is really simple.

提交回复
热议问题