How to transfer uncommitted changes in the workspace to a new branch in git?
怪我咯
怪我咯 2017-05-02 09:36:31
0
5
565

Suppose my current branch is develop. I forgot to open a new branch before starting new requirements, so I started to modify it directly in the workspace. Halfway through writing, now I want to open a new branch named skin, and put The modifications in the workspace are transferred to the new branch, the modifications in my local develop workspace are cleaned up, and the work is switched to the new branch to continue. How to do it?

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(5)
伊谢尔伦

Just switch branches directly

Peter_Zhu

Switch branches directly. Local modifications are not bound to the branch. The modifications you made after switching are still there.

我想大声告诉你

git stash, then create a new branch locally and switch to the new branch, then execute git stash pop, you can try it, it should work

小葫芦

Create a new skin branch directly in your local area, and then switch directly to your skin branch

phpcn_u1582
$ git checkout -b skin
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template