Search code examples
atlassian-sourcetreegit-stash

How to name a stash in SourceTree if possible?


I am using SourceTree (mac). I have a few stashed changes.

How do I give each stash a custom name to better identify what the code is supposed to do?

Right now when I stash it gets an automatic name in the form WIP on [branchname] [last commit message]


Solution

  • You can provide a name for the stash in the dialog box that opens when you create a stash:

    • Stage some changed files
    • Click the "Stash" button in the toolbar
    • The following dialog shows up. Provide a name in the "Message" field.
    • The provided "Message" will be used as the name of the stash

    Stash Message

    If you are trying to rename an existing stash, it looks like there's no way to currently do this in SourceTree - the only options in SourceTree are to apply or to delete the selected stash.

    Git in general does not provide a built-in way to rename a stash - the consensus seems to be to drop and recreate the stash with a new name. See how can I rename a git stash for a question that addresses this in more detail.