Open michael-hawker opened 4 years ago
I've seen other git clients like SourceTree do this as well.
I'm not familiar with it. Can you provide more details or show a screenshot at least?
The feature Source Tree has is documented here.
Their stash dialog has a checkbox that lets you keep the staged files in the workspace:
I do really like Fork's Stage New Files
option as well, but it'd be great to get the alternate mode to stash and keep staged files. It's super helpful for squirreling away some working parts of an environment.
OK, it's the --keep-index
option.
Not sure if we should introduce it. New (untracked) unstaged files will not be stashed. As for me, this can lead to a quite confusing result: staged changes remain staged, some unstaged files are stashed, another part of unstaged files are still there.
@DanPristupov yeah, but you're not always adding new files all the time. I think it in Fork, if they're two radio options that you can't both choose at once, then it'd mitigate that confusion. You can do one or the other, but not both.
What about stashing staged files? I'm probably doing something wrong, but I often find myself using git stash save -p
command from console in need to exclude some changes to test code without them.
What about stashing staged files?
The original is about stashing staged changes, which is different.
git stash save -p
This shows all changes, both staged and unstaged. Not sure how it can help us.
As for me, this can lead to a quite confusing result: staged changes remain staged, some unstaged files are stashed, another part of unstaged files are still there.
@DanPristupov I agree with this to some extent. But lack of such an option makes stash not quite useful. Is it possible to bring an option to stash the indexed changes only (inverse of --keep-index
)? This will make it seamless to move around the indexed changes between branches.
@DanPristupov what about implementing somehow the git stash -p interactive functionality? it let you choose what to stash and what not. It's great imho. It's one of the few command I find myself to use outside of fork
I want this feature quite often. I make some changes that I want to keep (but perhaps not commit yet), some changes that I want to stash for later (maybe to delete, but I want to keep them for a bit).
I would like:
Fork 1.98.0.0 allows us to select all the files in the Unstaged area and stash only them without impacting the Staged area. Isn't that enough?
No, I would like for only the unstaged changes to be stashed. I try to do this on occasion forgetting that's not the way it works and then I have to unstash and re-stage the changes I wanted.
@Srekel Ah, I think that message is incorrect. If you follow the steps mentioned above, it will stage only unstaged changes.
Sometimes I only want to stash part of my set of files. It'd be great to be able to stash a set of files, or just the unstaged ones or something. I've seen other git clients like SourceTree do this as well.