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.
The syntax of the command to stash specific files in Git is git stash push <file> . Thus, we do as follows to stash the changes done only to the file example. txt . Thus, we have stashed the changes only of the file example.
By default git ignores untracked files when doing stash. If those files need to be added to stash you can use -u options which tells git to include untracked files. Ignored files can be added as well if -a option is specified. -a will include both untracked and ignored files.
If you want to git stash pop twice because you want both stashes in the same commit but you encounter "error: Your local changes to the following files would be overwritten by merge:" on your 2nd git stash pop , then you can: 1) git stash pop , 2) git add . , and 3) git stash pop . This helped me.
In command line, you would:
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.
Pretty old question, but in the latest version of GIT Extensions, the "Manage Stashes" window accessible from the Commands menu has 2 buttons.
The second one does the job. Pretty obvious in retrospect.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With