Purpose: when you are working on a project on a branch, you suddenly have to stop and do other things, but because the project has not been changed, you can keep the site without the need to commit it, wait until you are busy and then reply to the site for further modification.
Bug handling stored at the development site
$ Git stash stores the current job site, so you can create branches with confidence to fix bugs.
First, determine the branch on which the bug will be fixed. If the bug needs to be fixed on the master branch, create a temporary branch from the master: $ git checkout master $ git checkout-B issue-101
After the repair is complete, switch to the master branch, complete the merge, and finally Delete the issue-101 Branch:
$ Git checkout master
$ Git merge -- no-FF-M "merged bug fix 101" issue-101
$ Git branch-d Issue-101
Use the GIT stash LIST command to view the storage work site
There are two ways to restore:
First, use git stash apply for recovery, but after recovery, the stash content is not deleted. You need to use git stash drop to delete it;
Another method is to use git stash pop to restore and delete the stash content.
You can use the GIT stash list to view and restore the specified stash multiple times. Run the following command: $ git stash apply [email protected] {0}
Git branch-D name forcibly deletes an unmerged Branch
Git stash save modification site