Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Stashing changes when switching branches or "magic stashing" #1633

Closed
lameyer opened this issue May 18, 2017 · 81 comments
Closed

Comments

@lameyer
Copy link

lameyer commented May 18, 2017

Continuation of #245, where it was decided to not automatically stash changes when switching branches for now.

I find "magic stashing" to be one of the most useful features of the previous desktop app. It enables you to think less about managing git, especially when switching between multiple feature branches. It also makes getting started with git easier and more approachable for a new user.

The option to stash when switching branches would be a good alternative, if "magic stashing" confuses users. I often make changes while testing or debugging that I don't want to commit but that I want to keep when switching to another feature branch. Having to go to the command line for stashing is inconvenient and lowers the usefulness of the Desktop app.

@niik
Copy link
Member

niik commented May 19, 2017

Thanks for opening this @lameyer. I'll just note for anyone coming here that a fairly common pattern for people who used the old app on Windows (where we didn't have magic stashing) was to commit everything with a commit summary of wip or something similar and then, when returning to the branch, simply undo the latest change. This flow still works in the new application and may be used as a workaround as this issue is discussed.

Here's a quick demo

@ebrearley
Copy link

ebrearley commented May 22, 2017

A temporary wip commit is fine as long as my changes aren't super out there and causing issues with linting and/or tests which can be run from the pre-commit hook (on repo's with this configured).

Thanks for the great tip though!

@beauallison
Copy link

+1 with @ebrearley - pre-commit hooks make this difficult and I often resort to stashing through the CLI - would love this functionality returned.

@niik
Copy link
Member

niik commented May 24, 2017

A temporary wip commit is fine as long as my changes aren't super out there and causing issues with linting and/or tests which can be run from the pre-commit hook (on repo's with this configured).

I hadn't considered hooks. That's certainly a scenario where that flow breaks down. Thank you @ebrearley and @beauallison for that perspective!

@fallanic
Copy link

fallanic commented May 24, 2017

Totally agree with @lameyer , magic stash and the ability to easily select lines to commit in a file are the two killer features which made me switch from command line to the desktop app.

I also agree about at least making the option available somewhere in the settings, but I still personally think it's better to enable it by default.
Just an idea : if it's confusing some users, why not try adding a small message explaining the magic stash happened, and changes will be "stashed pop" on next checkout of the branch?

The workaround can work in some cases but it's a bit tedious.
Also I was wondering, how long do the "commited just now / Undo" message and button stay for?

Edit : and BTW great job on the beta, the new UI looks pretty cool, and so far it's super stable, not so common for betas 👏

@joshaber
Copy link
Contributor

Thanks for the suggestion!

This idea is interesting for the future, but this is beyond the scope of our current roadmap.

I'm going to add the future-proposal label to this issue and close it out, so that we don't get overwhelmed with our backlog! We'll revisit these as part of our next planning session.

@fallanic
Copy link

Well it looks like it is on the roadmap already, first and 3rd bullet Feature completeand Replaces existing Desktop apps :trollface:

Just kidding 🙂 (kind of) but it's too bad the feature was removed, especially if "not many" people where complaining about it (according to #245 ).

I understand how it could confuse some users without a clear message explaining what just happened, but a handful of people sending emails to support shouldn't outweigh many people who love a feature hence don't contact support.

I hope the feature comes back in the near future, and kudos again on a great beta 👍

@j-f1
Copy link
Contributor

j-f1 commented Jun 29, 2017

@fallanic It wasn’t removed per se — they removed all of the features by starting over with a completely new codebase.

@fallanic
Copy link

I meant "dropped" sorry

@TytaniumDev
Copy link

Just wanted to add that I also really miss this feature, I had been using the old desktop client for so long that I thought this was just how git behaved! I agree this is probably best as a setting too.

If there's a better way to track general interest for a future proposal other than just leaving a comment like this let me know. I didn't see a way to star or +1 it.

@threadhead
Copy link

Hate to "me too" this, but I really, really miss this feature. I am typically working on 3-12 branches at any one time and need to quickly switch between. I may switch back to the old Mac version just for this feature alone.

@adamreisnz
Copy link

adamreisnz commented Sep 19, 2017

I'd also really like to see this put on the roadmap again. It's what made the previous app great -- being able to switch branches without thinking or worrying about your wip files.

Now, I'm being nagged by a popup and have to go to the CLI and type commands, which takes me out of my work flow and unnecessarily wastes time.

The wip commit, while maybe a good work around for some cases, is like others pointed out a problem if:

  • you are using deploy hooks,
  • others rely on a stable branch to work on,
  • you want a clean commit history.

@PascalPixel
Copy link

@joshaber This is the reason I use Github Desktop, I was surprised today that it's not in the new version (or any other way to stash)

@danyriv
Copy link

danyriv commented Oct 9, 2017

How many voted does this request need to make it to the roadmap? I really, really miss this feature. It definitely slows down the dev process when having to do fake commits to switch between branches.

@shamimmirzai
Copy link

Please add auto-stash. I've moved back to the old github desktop now. Well and truly, auto-stash was the killer feature that we loved about github desktop - please add it.

@PascalPixel
Copy link

PascalPixel commented Oct 16, 2017

  • Right now there is a popup saying 'stash changes first'
  • In the Tower git client, this same popup offers options:
    • Stash changes now (input title)
    • don't stash (moving the changes to the other branch)

This approach notifies the user that they are committing an act of treason against Git, yet offers a way out that isn't so blocking as it is now..

@fregante
Copy link

@Superpencil yeah explicit options are even better:

  • stash
  • keep
  • discard (I do this a lot)

@ghost
Copy link

ghost commented Nov 9, 2017

I really need this feature so much... I am considering to download gitkraken

@Xotabu4
Copy link

Xotabu4 commented Nov 15, 2017

Miss auto-stash so much. This simplifies teaching new guys how to work with git.

@northamerican
Copy link

northamerican commented Nov 16, 2017

When creating a new branch from master, GitHub Desktop also used to switch and 'carry over' your unstaged changes to the new branch. This and the auto-stashing paradigm it had were killer features. It's pretty much the use case for git stashing, all automated.

@fregante
Copy link

@northamerican the first feature you describe is still there, the changes are always carried over when switching, except when they conflict.

@northamerican
Copy link

@bfred-it ah i see! it's equally brilliant. saves a stage, stash, checkout, stash apply all in one go.

@shoes22
Copy link

shoes22 commented Nov 21, 2017

+1 for re-implementing magic stashing, or at the very least an option pop-up with the feature. My entire team has been using the old Github Desktop program for Mac, and we have become quite reliant on the feature in our workflow. It's not feasible to integrate the new version of Github Desktop into our current set-up without it.

@kparkov
Copy link

kparkov commented Nov 28, 2017

I am currently doing a programming course, and trying to avoid making it a git course. The only client easy enough to use to keep git out of focus is GD. However, as each student have a branch that they can use for saving their exercise solutions, it becomes very awkward when they have made changes while on master, and cannot switch to their own branch. The commit/undo routine is just weird when trying to keep it simple. Magic stashing would be a great relief here.

@barbara-sfx
Copy link

Can anyone name one mainstream desktop app that forces you to go to the command line to perform a common, simple operation? I don't think so.

Also, Mac users love the feature, Windows users never had it, so the solution is to take it away from everyone? Really?

If there are issues related to magic stashing, as listed above, wouldn't those same issues surface if someone used the command line to stash? I mean, aren't these git issues, not desktop app issues? If stash would throw an error if run at the command line, then magic stashing could do the same thing: display the error and tell the user the stashing failed and they need to deal with it.

And if those issues are corner cases, as you say, well there are always going to be corner cases. Right now you have many people just not using the new app as opposed to a few corner cases. I really think you made the wrong call here.

Anyway, IMHO, the minimal flow should be:

  • I try to change branches
  • Modal popup - You have uncommitted changes. Stash changes?

Buttons: Stash (default button implemented if you hit Return; stashes and switches to selected branch); Cancel: Returns you to the app.

Even better flow: Add checkbox Do not ask again
i.e. make "Always stash when switching branches" an option you can set in preferences.

If you think this is even better:

Modal popup: You have uncommitted changes. What do you want to do?
Buttons: Stash (as above); Carry over [new, undesirable behavior that applies uncommitted changes to the target branch]; Cancel

I would still want to see option in preferences if you feel people are likely to always choose one or the other.

@adamreisnz
Copy link

@shiftkey any update on magic or manual stashing (#2304)?

Counting just these two issues, it seems that more than 100 votes have been cast to get some form of stashing into the app. Are you taking this into account in your roadmap planning? It seems this is by far the most widely requested feature, which judging by the comments is still holding back many users from adopting the new version.

@tylerweitzman
Copy link

Same +1

@wazawoo
Copy link

wazawoo commented Aug 30, 2018

+1. I will not use the new app or use any other app unless this feature appears in them. This was my first git client (before even learning command line git), and it was just perfectly natural that switching branches would save your progress on the branch you were on before, and you could switch back to it later and all the work in progress would be there. When I had to use Windows at work, I started out using git in the command line, and was constantly annoyed with how you would have to stash before switching branches. What if I forget that I had work in progress stashed on that branch? You have to manage it manually. So I thought, if I get a GUI client, maybe it will have the neat branch switching behavior. Turns out, no. No such (magic stashing) solution exists on Windows (that I have found). I found the next best thing on GitKraken, with stashing in the app, and a visual indication of when you have stashed work on a branch. This is still not ideal, but it works. But when I tried the updated GitHub Desktop, it didn't have magic stashing, and didn't have any way to switch branches with work in progress without leaving the app to stash with the command line. Maybe I was just spoiled when magic stashing was around, but it was such an awesome git experience, and I will never work on Mac without it.

@billygriffin
Copy link
Contributor

billygriffin commented Aug 31, 2018

Thanks for the feedback folks, and I absolutely appreciate the desire to have nicer handling of stashing in the app. We're evaluating all of these issues designated as future-proposal here (#5398) and it should be more obvious what we are and are not working on (and how we decide) in the next few months. In addition, we hope that process will unlock the potential of the Desktop open source community to contribute some of these more useful features. I apologize for the delay in responding and appreciate that this is important.

@a0930119952

This comment has been minimized.

@barbara-sfx
Copy link

Not that anyone probably cares, but because the old version of the desktop software stopped working today, I had to find an alternative. I found a different free app that - SURPRISE! - has both Stash and Pop icons right there on the toolbar along with Push and Pull. What a concept. I'm breathing a sigh of relief.

@billygriffin
Copy link
Contributor

Thanks for letting us know @barbara-sfx, and I hope it works well for your needs. We’re planning to work on this - I drew up a new issue today in #6107 to tee that up and get any feedback on what problems we’re solving before we kick off the work.

@barbara-sfx
Copy link

I'm glad to hear that you are planning to put it back on the roadmap sooner rather than later.

@agarny
Copy link

agarny commented Nov 6, 2018

@barbara-sfx: not sure I understand your message. For one, the old GitHub Desktop application still works fine. Second, you mention a different app and praise it (why not, indeed), but don't even mention its name... or is that just you being sarcastic?

@barbara-sfx
Copy link

barbara-sfx commented Nov 6, 2018

Well the old version isn't working for me, for whatever reason. You are lucky it's still working for you! Maybe it's an OS thing.

I don't think it's appropriate to name a competitor here. I just searched around and tried a couple that I found and picked one I liked. If this feature request gets addressed, I could see myself coming back at some point.

@agarny
Copy link

agarny commented Nov 6, 2018

Well the old version isn't working for me, for whatever reason. You are lucky it's still working for you! Maybe it's an OS thing.

FWIW, I am using the old GitHub Desktop application on macOS.

@nitinsingh-cb
Copy link

Why not have an option of custom action where you can apply any git command to a selected set of lines? You can then chose to discard, save, compare, edit or whatever. You only need to know the correct git command :)

@pomplesiegel
Copy link

I really miss the stashing behavior as well! I thought I was going crazy recollecting how the software previously behaved.

@GriffinSauce
Copy link

I too would love to have this feature back, maybe as an option. It was a massive speed boost compared to more "raw" git interactions.

On the other hand I understand the hesitation noted, it would definitely help to make it more visible (like the contextual button instead of sync).

@billygriffin
Copy link
Contributor

Hi folks! We're looking at this in #6107 - we're referencing all the feedback here as well, just for context, but just wanted to let y'all know where that work is happening. It is prioritized on our roadmap so it's definitely something we're working on in the next couple months.

@Thaina
Copy link

Thaina commented Jun 5, 2020

+1 for this. This is very common scenario for switching branch. Why this was closed?

@adamreisnz
Copy link

adamreisnz commented Jun 5, 2020 via email

@Thaina
Copy link

Thaina commented Jun 5, 2020

@adamreisnz Really? I may not updated things for too long just try to use it and still don't work in my machine

@adamreisnz
Copy link

adamreisnz commented Jun 5, 2020 via email

@shamimmirzai
Copy link

The option to auto-stash is present in the new client which is great, but it doesn't auto-restore when I switch back to that branch, which the old client does.

@adamreisnz
Copy link

adamreisnz commented Jun 5, 2020 via email

@jnettels
Copy link

jnettels commented Sep 16, 2021

I do not use GitHub Desktop myself, but recommended it to some new users because I thought it would be more approachable than the command line. Then I had multiple incidents where these users thought they had lost data - because of the "magic stashing". Once we found the stash everything was fine, but they (obviously) had no idea what a stash was and how they could retrieve the data. In my opinion this should be turned off by default, until the user is educated about how to use it.

Can you actually turn it off?

@agarny
Copy link

agarny commented Sep 16, 2021

In my opinion this should be turned off by default, until the user is educated about how to use it.

I imagine this is never going to happen and thank god for that. I hate it when I install a piece of software and the first thing I have to do is to turn some "basic" features. I can't remember, but doesn't GH Desktop pops up a message when magic stashing is first triggered? If not then this is the behaviour I would probably go for.

@billygriffin
Copy link
Contributor

Hi folks, just to be clear, "magic stashing" (in other words, stashing automatically without asking) is not enabled by default. The default behavior is that when someone switches branches, they're given the option to bring changes to the new branch or stash the changes on their current branch. If they want to change that, this option is in Preferences:

Screen Shot 2021-09-20 at 7 34 29 AM

@agarny
Copy link

agarny commented Sep 20, 2021

Hi folks, just to be clear, "magic stashing" (in other words, stashing automatically without asking) is not enabled by default. The default behavior is that when someone switches branches, they're given the option to bring changes to the new branch or stash the changes on their current branch. If they want to change that, this option is in Preferences:

Oh, I had forgotten about that. Much better indeed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests