Skip to content

more helpful text when restoring a stash is disabled in stash diff viewer #7395

Open

Description

@outofambit

stashing message

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

originally from @nerdneha in #7363 (review)

Activity

  1. added
    design-input-needed
    on Apr 24, 2019
  2. added this to the 1.7.0 milestone on Apr 24, 2019
  3. tierninho commented on Apr 24, 2019

    @tierninho
    Contributor

    Would this change be surfaced in the stashing diff page or would we adjust the messaging on the next steps page?

  4. billygriffin commented on Apr 25, 2019

    @billygriffin
    Contributor

    @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.

  5. removed this from the 1.7.0 milestone on May 21, 2019
  6. added
    epic:stashing
    on Jul 10, 2019
  7. samupp2758 commented on May 6, 2020

    @samupp2758

    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.

  8. steveward commented on May 6, 2020

    @steveward
    Contributor

    @samupp2758 if you commit your changes you will not lose the option to restore the stash -- it will still be available.

  9. Spiderguy-F commented on Mar 8, 2021

    @Spiderguy-F

    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...

  10. creatively commented on Dec 6, 2021

    @creatively

    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.

  11. kaptantsu commented on Dec 23, 2022

    @kaptantsu

    @creatively you are a perfect man

  12. serg3y commented on Aug 15, 2023

    @serg3y

    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.

  13. 0xdevalias commented on Dec 17, 2023

    @0xdevalias

    RE: #7395 (comment)

    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.


    Tangentially related:

  14. added
    not-planned
    on Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    design-input-neededenhancementepic:stashingnot-planned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions