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
Feature request: Stashing changes when switching branches or "magic stashing" #1633
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.
Reacted by Brian Surowiec, Idan Adar, Sindre Sorhus, Beau Allison, Cameron Murphy, Eric Brearley, Fabien Allanic, Javis V. Pérez, Edgar Nadal, Mark Powell and 87 more
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
Reacted by fregante, shruti3101, Nico Thiebes and Moss Drake
Reacted by Marian Bäuerle, Adrian Ziemkowski, Seph Soliman, Chris Bitsakis, Kristian Videmark Parkov, Sebastiaan de Weert, Paul Bruneau, Jean-Philippe Bergeron, Holly Howard, Peter T Cormack and 18 more
Reacted by Guillaume Barthelemy, msat, fkoseoglu and RoryMcCrossan
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!
Reacted by Beau Allison, Lindsey Meyer, orange-tsai and Aurélien Chivot-Buhler
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!
Reacted by Beau Allison, Adam Reis and Callum Locke
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 👏
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.
Reacted by Adrian Ziemkowski, AshleyB, Josh Foskett, Peter T Cormack, Alan Garny, Rubin Huang, clorbus, Nilanshu Jaiswal, Aurélien Chivot-Buhler, RoryMcCrossan and 5 more
Well it looks like it is on the roadmap already, first and 3rd bulletFeature completeand Replaces existing Desktop apps
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 👍
Reacted by Adam Reis, Pascal Pixel, Denis Mikhaylov, Adrian Ziemkowski, Steve Suranie, Ryan Fauver, Florian Saenger, Callum Locke, Brendon Muir, Josh Foskett and 6 more
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.
Reacted by Peter T Cormack, clorbus and Kate Willison
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.
Reacted by Adrian Ziemkowski, Shamim Mirzai, Florian Saenger, Alex Robertson-Brown, Peter T Cormack, Stephen Tse, clorbus, Kate Willison, Calvin Shell, Brian Helinski and 2 more
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.
Reacted by Daniel Schniepp, Ryan Kim, chandraveerr, Shamim Mirzai, Zach Lipson, Ryan Fauver, Florian Saenger, Pierre-Olivier Bédard, Debdeep Majila, Alex Robertson-Brown and 6 more
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 :)
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.
Reacted by Alan Garny, Jun Young Lee(Jun), Dino DiGiulio and Jason Gilley
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.
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.
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.
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:
Reacted by Peter T Cormack, Joris Zimmermann, Pier Bover and Looky1173
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!
Activity
niik commentedon 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
wipor 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 commentedon 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 commentedon May 24, 2017
+1 with @ebrearley - pre-commit hooks make this difficult and I often resort to stashing through the CLI - would love this functionality returned.
niik commentedon May 24, 2017
I hadn't considered hooks. That's certainly a scenario where that flow breaks down. Thank you @ebrearley and @beauallison for that perspective!
fallanic commentedon 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 commentedon Jun 29, 2017
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-proposallabel 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 commentedon Jun 29, 2017
Well it looks like it is on the roadmap already, first and 3rd bullet
Feature completeandReplaces existing Desktop appsJust 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 commentedon 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 commentedon Jun 29, 2017
I meant "dropped" sorry
TytaniumDev commentedon Jul 12, 2017
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 commentedon Sep 7, 2017
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 commentedon 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:
57 remaining items
nitinsingh-cb commentedon Nov 26, 2018
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 commentedon Feb 1, 2019
I really miss the stashing behavior as well! I thought I was going crazy recollecting how the software previously behaved.
GriffinSauce commentedon Feb 5, 2019
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 commentedon Feb 5, 2019
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 commentedon Jun 5, 2020
+1 for this. This is very common scenario for switching branch. Why this was closed?
adamreisnz commentedon Jun 5, 2020
Thaina commentedon 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 commentedon Jun 5, 2020
shamimmirzai commentedon Jun 5, 2020
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 commentedon Jun 5, 2020
jnettels commentedon 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 commentedon Sep 16, 2021
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 commentedon 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:
agarny commentedon Sep 20, 2021
Oh, I had forgotten about that. Much better indeed!