Typically, add the changes you don't want to hide to the index, then use the --keep-index option to hide them.
bashgit add app/controllers/cart_controller.php git stash --keep-index git reset
The last step is optional but usually necessary. It removes the changes from the index.
Warning
git stash --keep-index pushes all changes to the stash, including both staged and unstaged changes. After the stash is created, only the index remains. When you later pop the stash, this may result in merge conflicts.
2024年6月29日 12:07 回复