git- Creating a branch which will be pushed to a remote later

后端 未结 3 706
悲哀的现实
悲哀的现实 2021-01-12 01:45

I have a script which automatically creates a new branch with a name based on external information (JIRA ticket). I don\'t want to create the remote branch until I\'ve commi

3条回答
  •  春和景丽
    2021-01-12 02:14

    Try --track instead of --set-upstream-to, eg:

    git branch --track origin/mynewbranch

    I haven't found out exactly what the difference between the two is, but --track seems to do what you're wanting (and what I was wanting to do when I found this question!)

提交回复
热议问题