leftrain.blogg.se

Git stash drop
Git stash drop











The next screen shot shows using git stash without any arguments. Here I’ve got a change to the file ready to be staged or stashed.

Git stash drop how to#

I’ve created a simple repository with a single file to show some examples of how to use git stash. The documentation shows the full list of options for git stash. While there are more options available for git stash this list contains the majority of what is needed for normal usage.

  • git stash drop – Delete the stash from the list.
  • git stash pop – Same as apply but remove the stash from the list.
  • git stash apply – Apply the changes from the stash and leave the stash in the list of stashes.
  • git stash list – Show the list of stashes for this repository.
  • git stash -m – Same as above but attach the message to the stash instead of the commit ID.
  • git stash – This will store your current changes and clean your working directory.
  • TL DR – What are the commands I need to know for git stash? When I’m ready to come back to the changes I stashed I can simply pull them out of the stash using git stash pop and continue my work. At this point I can work on the other set of necessary changes.

    git stash drop

    Once the changes have been saved the source tree is returned to the state of the latest commit. What happens when this comes at a point that I’m not ready to commit? git stash to the rescue! Just as the name indicates git stash allows changes to be stashed away for later use. For me these interruptions often come in the form of: Please switch to working on this other thing. Heck they’re even common for me when I’m working by myself. Interruptions are fairly common when working on a large project.











    Git stash drop