19

Is there a way with Git Extensions to only stash some of the uncommitted files?

Say I have three files changed in the working dir (uncommitted) but I only want to stash 2 of them. FYI It doesn't seem to matter whether the uncommitted files are staged or not - when I use stash, they all get stashed.

Cincinnati Joe
  • 2,077
  • 6
  • 23
  • 32

3 Answers3

13

Pretty old question, but in the latest version of GIT Extensions, the "Manage Stashes" window accessible from the Commands menu has 2 buttons.

  • Stash All Changes
  • Stash Selected Changes

The second one does the job. Pretty obvious in retrospect.

pasx
  • 2,718
  • 1
  • 34
  • 26
Wade Hatler
  • 1,785
  • 20
  • 18
  • Pretty not obvious, why does "Select all changes" ignores new files, while word "all changes" should exactly mean ALL changes (including new files, because it is also changes in codebase, obviously) – Win4ster Dec 07 '22 at 10:28
10

In command line, you would:

  • add to the index the files you don't want to stash
  • do a git stash save --keep-index, as mention in this answer or this one.

Since issue 479 of GitExtensions, you should be able to do the same, since there should be a checkbox to the stash form which appends '--keep-index' to the 'stash save' command.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
6

To add files to stash in GitExtensions: in the top menu click:

  • Commands

  • Stash changes

To retrieve stash using GitExtensions, use the same menu, which will now contain a history of stash, select the file(s) you want to retrieve and then click 'Apply Selected'

Spyder
  • 3,784
  • 3
  • 26
  • 15
  • 3
    That's how you access the Stash capabilities. But that doesn't address how to use them to only stash particular files (instead of all of them). See the accepted answer above. – Cincinnati Joe Dec 05 '16 at 13:22
  • There is no Stash Changes option in my Commands menu. – sergiol Oct 11 '21 at 11:36