Posted almost 2 years ago. Visible to the public. Repeats.

Git stash: Working with old Entries

First find the reference for the entry you want through looking at the stash:

Copy
$ git stash list stash@{0}: WIP on feature/foo stash@{1}: WIP on feature/bar stash@{2}: WIP on fix/baz

Now you can simply use that reference, but curly braces must be escaped:

Copy
git stash pop stash@\{1\}

or quoted:

Copy
git stash apply "stash@{1}"

Quick reminder to not shoot yourself in the foot:

  • apply applies the entry to the working directory but will not delete it from the stash
  • pop applies and deletes the entry from the stash (only if there were no conflicts when applying it)
  • drop will only delete and not apply the entry

Running these commands without a reference will use it with the last entry.

Partial stash pop

Sometimes you only want to pop parts of the stash. Do this the way vice versa:

Copy
git stash pop git stash -p # Now move all the unnecessary parts back into the stash

With tig

tig offers an easy way to browse through the contents of your stash as well: tig stash. Navigating works as expected.

Does your version of Ruby on Rails still receive security updates?
Rails LTS provides security patches for old versions of Ruby on Rails (3.2 and 2.3).

Owner of this card:

Avatar
Judith Roth
Last edit:
1 day ago
by Judith Roth
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Judith Roth to makandra dev
This website uses cookies to improve usability and analyze traffic.
Accept or learn more