Sublime Forum

Can I stash a specific file?

#1

I sometimes stash specific files using

git stash push <path_to_file>

Is this possible through sublime merge?

If not I would appreciate a stash button next to the discard / stage or something like that.

0 Likes

#2

see Features Request: Stage file by filename

0 Likes

#3

Thanks for this, but this is about staging not stashing.

0 Likes

#4

Create a file “Diff Context.sublime-menu” in your package user directory and paste the following:

[
    {
        "caption": "Stash file",
        "command": "git",
        "args": {"argv": ["stash", "push", "$path"]}
    }
]

Now when you right click in the diff of a file in your working directory you can stash just this file.

5 Likes

#6

Sweet, this worked thank you very much!

0 Likes

#7

Wow! This is some serious sorcery!

FYI: “package user directory” details can be found here.
https://www.sublimemerge.com/docs/packages

0 Likes