Git switch branch development


When developing under master, some files need to be submitted to the test branch

1. Git stash can save all uncommitted modifications (workspace and staging area) to the stack for subsequent recovery of the current working directory.

2. Git stash pop pops up the contents of the current stash and applies them to the working directory corresponding to the current branch.
Note: this command deletes the most recently saved content in the stack (the stack is first in and last out)

3 git stack – U stores untracked files. You can use the – U option

4 git checkout test switch branch

5 git stash pop

6 next, you can perform normal operations such as git add