First published in the language document @blueju

git stash & git add

The use of git add and Git Stash is more detailed

  1. Git-scm.com/docs/git-st…
  2. Git-scm.com/docs/git-ad…



An opportunity to

The opportunity to find this clever use is that once you need to use git Stash to hide the modified content, but after using git Stash, you can only hide the modified items and also hide the new items. What can you do?

I checked the files, and I did. I can’t trust you.

practice

I modified it and added it.



Direct git stash, resulting in only successful hiding of changes, not new ones.



First git add, with git Stash, successfully hides new additions and changes.

harvest

Corrected my misrepresentation of git add and Git Stash

I used to think of git Stash as a way to temporarily hide workspace additions and modifications (not new in the workspace, but included in the index)

supplement

Git statsh -u can achieve the same effect