Command: Git stash
1. Using git stash to
save the current work site , you can switch to another branch to work, or do other urgent work on the current branch, such as revising a bug test submission .
2. If a git stash is used to switch to a branch, and the work on that branch is not completed, it needs to save its work site. Then use Git stash. Then
there are two job sites in the stash queue.
3. You can use Git stash list. View the stash queue.
4. What to do if you want to restore a job site on a branch: first use Git stash list to view the stash queue. Determine which
work site to restore
to the current branch . Then use git to stash pop [email protected]{num}. Num is the number of the job site you want to restore.
5. If you want to empty the stash queue, use git stash clear.
6. Also note that the use of the Git stash pop command is to restore the stash queue [email protected]{0}, which is the topmost job site. and using the pop command to recover the work site, its corresponding stash is deleted in the queue.
Using the git stash apply [email Protected]{num} method is not the same as Git stash pop
except stash queue deletion.
=====
When you have an emergency job and don't want to commit to doing half of the work now, git stash and then switch to the other branch for emergency work.
Git stash (Save the current job site)