The git stash command takes both staged and unstaged commands and storedms them internally, then clear the current working directory.
This can can be very handy given e.g. You were working on a feature and were told to add another feature that would not take alot of your time.
You have to options:
1)git reset --hard which will cause all your earlier work to be lost.
2)git commit -m "message" this would cause you to commit a half-baked feature.
You have to options:
1)git reset --hard which will cause all your earlier work to be lost.
2)git commit -m "message" this would cause you to commit a half-baked feature.
The third option is to use the git stash command.
Use git stash pop to cause stored changes to re-appear in current working directory, then continue working on incomplete feature.
If you had multiple stashes you can use git stash list to view all of them, then choose which ones you would line to pop.

No comments:
Post a Comment