As coder said, just create a new branch and cut to it.
However, if you want to switch to an existing branch, for example, after making changes, you find that you should commit on another existing branch, there may be a conflict when switching over. At this point you need to use the stash function:
git stash
git checkout other_branch
git stash pop
git commit -av # or whatever
As coder said, just create a new branch and cut to it.
However, if you want to switch to an existing branch, for example, after making changes, you find that you should commit on another existing branch, there may be a conflict when switching over. At this point you need to use the stash function:
You only need to execute the command to create a branch under the current branch:
git checkout New branch
git cherry-pick master