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

前端 未结 6 2042
闹比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:57

    Follow these steps:

    1. Create a new branch:

      git branch newfeature
      
    2. Checkout new branch: (this will not reset your work.)

      git checkout newfeature
      
    3. Now commit your work on this new branch:

      git commit -s
      

提交回复
热议问题