question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Stash specific file/s

See original GitHub issue

Describe the feature or problem you’d like to solve

Currently, stashing uncommited changes in files can be done be in the Branch tab.

This only allows stashing all changed files.

Would be really handy to allow selecting which files to stash.

Cases like bringing changes with you to a different branch,

but only needing some changes, come to mind.

Proposed solution

When compared to available capabilities to discard changes.

You can also selectively discard changes on specific files.

image

My idea is to add another option in the context menu to stash (Text being something along the line of Stash changes).

Allowing stashing of single/multiple changed files.

Behind the scenes would probably apply the command

git stash push [FILE PATH] [...ADDITIONAL FILE PATHS...]

Visual representation wise,

there is currently the popped up footer with the stashed changes, which could simply add to it files if any more files are selectively stashed.

With the same functionality to restore or discard everything in the stash.

image

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:30
  • Comments:11

github_iconTop GitHub Comments

10reactions
the21stcommented, Jun 1, 2021

It would be great if we could stash not only the selected files, but only the selected chunks/lines inside those files, since this partial selection is already available for committing.

Thanks!

3reactions
NickSantini32commented, Aug 29, 2022

+1 For this. Im a long time user of GitHub desktop and this really becomes useful when trying to move branches around.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I git stash a specific file? - Stack Overflow
In Source Control tab of vs-code, hold shift key and then select the files you want to stash, ...
Read more >
How to Git Stash Specific Files | phoenixNAP KB
The git stash command stashes all tracked files in the current working directory. Stashing a specific file requires the additional push option ...
Read more >
Git Stash Single File | Tangent Technologies
The quick way to Git stash a single file is using git stash with a file specifier eg.
Read more >
How to stash a specific file or multiple files? - DEV Community ‍ ‍
As Ben pointed out, you may use git stash path/to/file path/to/other/file to stash specific files. Another handy tip is that git provides ...
Read more >
7.3 Git Tools - Stashing and Cleaning
Stashing takes the dirty state of your working directory — that is, your modified tracked files and staged changes — and saves it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found