gitgit-extensions

Stash just one file with GitExtension


I have sample SpringBoot application with just two classes, just for test the manage stash feature of Git Extensions 3.5.4.12724.

I know this question has been asked several times here and I have read a lot of response but none of these work.

So suppose we have a project with two file, and we stash both them. We'll have a view on GitExtension -> Manage Stash like follow:

enter image description here

Now if I wanted to add only the changes made to the file DockerDemoApplication.java (the first) and I select it and click on Apply Selected Stash, GitExtension applies the changes for all the files in the list.

Do I Stash my files in wrong way? Is not the Manage Stash the properly feature to do this job? Or is a bug of an older version?


Solution

  • 'Apply selected stash' is applying all the changes on all the files contained in the stash and it is normal because normally you manage a stash as a whole and it is relatively rare to apply part of it.

    You should right click on the file you want to apply the changes and you will have a menu with the menu item "Cherry pick file changes":

    enter image description here

    You could even apply only part of changes from a file from the diff view on the right and by selecting only the changes you want and choose "Stage selected line(s)" (or press the 'S' --like 'Stage'-- key) :

    enter image description here