You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
more helpful text when restoring a stash is disabled in stash diff viewer #7395
When I read the helper text for the scenario where we have uncommitted changes
Unable to restore stash when changes are present on your branch.
I feel a little helpless and think "well what are my options right now?" aka "what do you want me to do about it?" It's not our obligation to help them further than the command line but I think we can do better and at least give them a suggestion. As fodder for thinking, here are a few things the user COULD do (that we don't have to necessarily prescribe):
a) commit my existing changes and then restore my stash
b) discard this stash and say goodbye to them forever
c) manually stash on the command line
d) copy and paste my changes to a notepad and then discard and then create the changes again
e) discard my changes and restore my stash
@tierninho You're never seeing the suggested next step unless you have no local changes, so this confusion is only relevant when the user has local changes and is viewing a stash.
I used stash, then fetch. I think it pulled the current branch, because it reports changes compared to my stash (although it wouldn't make much sense), however I don't have any (merge) options, just discard. Can't pull, this message appears: unable to restore stash while there are changes present.
Changes compared to what? before I stashed, after I fetched, after I pulled?
What are possible solutions?
Why is the restore button grayed out?
Why has the pull button disappeared after stashing?
I totally agree, more information would definitely help.
I would expect it to work like this:
Stash (optional just commit) -> pull -> merge (with options) -> do whatever, commit again, push, continue working...
I HAD the same problem, and pulled 65% of my hair out manually typing in all the lost file contents [cry emoji] before getting a solution [lightbulb imoji]
Go into the actual local files
Delete/remove any changes that are ALSO showing as green in the GitHub Desktop stash list.
The greyed out "Restore" button should now have turned a beautiful shade of green.
(If not green, pull out some more said hair and ignore this post)
If "Restore" now clickable, then click it, and cry (with happiness this time) as the stashed changes return back to their old home on your branch.
Reacted by GeorgiaFayne, Yuna, Marcos V. dos Santos, mustafa bektasoglu, Nguyễn Trần Công Hoàng, Serge and Glenn 'devalias' Grant
Why can't there be more then one stash?
If that was possible then I would be free to change brunches without having to resolve this conflict right away.
'kicking the can down the road' perhaps, but i found myself on a shared computer with this problem and could not switch to master without messing without commuting another person's unfinished work to his brunch first.
I HAD the same problem, and pulled 65% of my hair out manually typing in all the lost file contents [cry emoji] before getting a solution [lightbulb imoji]
Go into the actual local files Delete/remove any changes that are ALSO showing as green in the GitHub Desktop stash list. The greyed out "Restore" button should now have turned a beautiful shade of green. (If not green, pull out some more said hair and ignore this post) If "Restore" now clickable, then click it, and cry (with happiness this time) as the stashed changes return back to their old home on your branch.
This is has been one of my issues with a lot of git GUI's stash viewers. Sometimes I want to see the full contents of the stash, but sometimes I just want to view a diff them against my current changes to preview what is going to change if I applied it.
Activity
tierninho commentedon Apr 24, 2019
Would this change be surfaced in the stashing diff page or would we adjust the messaging on the next steps page?
billygriffin commentedon Apr 25, 2019
@tierninho You're never seeing the suggested next step unless you have no local changes, so this confusion is only relevant when the user has local changes and is viewing a stash.
samupp2758 commentedon May 6, 2020
I still stuck on this, and I don't know that if I commit, or update the local repo, I'm gonna lose my restore stash.
steveward commentedon May 6, 2020
@samupp2758 if you commit your changes you will not lose the option to restore the stash -- it will still be available.
Spiderguy-F commentedon Mar 8, 2021
I used stash, then fetch. I think it pulled the current branch, because it reports changes compared to my stash (although it wouldn't make much sense), however I don't have any (merge) options, just discard. Can't pull, this message appears: unable to restore stash while there are changes present.
I totally agree, more information would definitely help.
I would expect it to work like this:
Stash (optional just commit) -> pull -> merge (with options) -> do whatever, commit again, push, continue working...
creatively commentedon Dec 6, 2021
I HAD the same problem, and pulled 65% of my hair out manually typing in all the lost file contents [cry emoji] before getting a solution [lightbulb imoji]
Go into the actual local files
Delete/remove any changes that are ALSO showing as green in the GitHub Desktop stash list.
The greyed out "Restore" button should now have turned a beautiful shade of green.
(If not green, pull out some more said hair and ignore this post)
If "Restore" now clickable, then click it, and cry (with happiness this time) as the stashed changes return back to their old home on your branch.
kaptantsu commentedon Dec 23, 2022
@creatively you are a perfect man
serg3y commentedon Aug 15, 2023
Why can't there be more then one stash?
If that was possible then I would be free to change brunches without having to resolve this conflict right away.
'kicking the can down the road' perhaps, but i found myself on a shared computer with this problem and could not switch to master without messing without commuting another person's unfinished work to his brunch first.
0xdevalias commentedon Dec 17, 2023
RE: #7395 (comment)
This is has been one of my issues with a lot of git GUI's stash viewers. Sometimes I want to see the full contents of the stash, but sometimes I just want to view a diff them against my current changes to preview what is going to change if I applied it.
Tangentially related: