title: Remove git stashes beyond N
body: <p>I stash changes in git regularly and have built up quite a long stash list (and 'stache, coincidentally). My current repo has 68 stashes. Is there a way to cleanup the stash list by clearing all but the N most recent stashes?</p>
  
  <p>Options I've looked into:</p>
  
  <p><code>git stash clear</code> - removes the entire stash list</p>
  
  <p><code>git stash drop &lt;stash&gt;</code>- removes the specific <code>&lt;stash&gt;</code></p>
  
  <p>The first option would remove the entire stash list, the latter would require a few dozen commands. I'm looking for something along the lines of how <code>git rebase -i HEAD~N</code> works, where a number can be supplied to the command. </p>