Forgot to create new branch. How to transfer changes to new branch

前端 未结 6 2063
闹比i
闹比i 2021-02-19 13:45

this happens to every developer time-to-time. You start coding a new feature and forget to branch first locally.

So if that happens is there a way I can say hey, transf

6条回答
  •  死守一世寂寞
    2021-02-19 13:48

    If you haven't commited your changes yet, you can switch to a new branch prior to committing.

    git checkout -b my-new-branch
    

    This will create a new branch called my-new-branch and immediately check it out.

提交回复
热议问题