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

前端 未结 2 1329
旧巷少年郎
旧巷少年郎 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:43

    You can stash your current changes (git stash), switch to the new branch and then apply the changes to the new branch using

    git stash pop
    

提交回复
热议问题