Git: Can I commit my working directory to a new branch without committing it to a current branch?

前端 未结 2 1302
旧巷少年郎
旧巷少年郎 2021-01-01 17:23

I am working on a project, and had all of my tests passing on the master branch. I then made some changes, and when everything started failing, I realized that maybe I shou

2条回答
  •  有刺的猬
    2021-01-01 17:47

    Yes, just create the new branch and check it out:

    $ git checkout -b new-branch
    

    Then commit any changes you have. They'll be applied to the new, checked-out branch.

提交回复
热议问题