How do you create a remote Git branch?

后端 未结 23 2210
感情败类
感情败类 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 13:58

    I have used two ways to create branch

    If you are using TortoiseGit follow these steps:-

    1.Create Branch using TortoiseGit

    Right click on your project >>> TortoiseGit >>> Create Branch >>> write the name of branch and select the base branch then press ok

    2.Push the branch

    Right click on your project >>> TortoiseGit >>> push >>> click ok

    3.Switch to new branch

    Right click on your project >>> TortoiseGit >>> Switch/Checkout >>> select newly created branch and press ok

    If you are using command prompt follow these steps:-

    1.Create branch using command prompt

    $git checkout -b new_branch_name

    2.Push the branch

    $git push origin new_branch_name

    3.Switch to new branch it will already switched to new_branch_name otherwise you can use

    $git checkout new_branch_name

提交回复
热议问题