How do I stash uncommitted changes in Visual Studio 2013

Multi tool use
Multi tool use
The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


How do I stash uncommitted changes in Visual Studio 2013



Need some help on how I can shelve uncommited changes in a Git repository using Visual Studio 2013. I come from PHPStorm where you can shelve uncommited changes on one branch, switch to another and unshelve.



However, I can't find/see how this can be done in Visual Studio. Could someone shed some light on this issue?



Just to clarify why this may be needed: I might be working on branch X, and then figure that I am the wrong branch and I should be on branch Y. I need to shelve all changes from branch X, switch to branch Y, unshelve changes and then commit.



Thanks.




3 Answers
3



In git the concept you're looking for is stash. You add your changes as if you are going to commit them, and you then stash them with git stash. After changing branches, you can git stash apply or git stash pop (with the former leaving the stash available for reuse).


git


stash


git stash


git stash apply


git stash pop



I'm familiar with the shelf concept from Perforce, which has a useful difference from Git's stash -- where you can send a shelf to the server and share it with other people, you cannot do that with git. However, with git you can just create a branch with the stash and push that to the server, allowing others to merge it where it's needed.


shelf



Microsoft does not provide a way to use this feature.





Is there some sort of way to do this using Microsoft's Git Provider plugin?
– teh0wner
Oct 27 '13 at 13:33





Sorry, I'm unfamiliar with that plugin. I use git from the command line and through the SourceTree (on OS X, but a Win version exists) program. I would suggest looking in the same place you can commit and looking for a stash option there.
– mah
Oct 27 '13 at 14:45





In my opinion this does not answer the OP question, which I would rephrase to: "How to do git stash in VS 2013 IDE". I'm also looking for it but came to the conclusion it is not supported (at least with VS 2013 Update 2). I found also you can vote for it here You can use this guide to setup Package Manager Console to behave as git command line.
– eXavier
May 19 '14 at 14:57


git stash



Visual Studio 2013 Update 2 does not support shelving (called stashing in git) for git repositories, but you can use 3rd party tools on the repository itself (I use SourceTree).





That you can use git tools on git repositories is not informative. Suffice to say that despite virtually unlimited resources, Microsoft inexplicably gives you an impoverished git interface. I can't image what technical difficulties would prevent that and suspect there are none.
– Rick O'Shea
Jan 6 '16 at 21:06





How is it not informative to point someone to tools they may not have considered? Just because you're angry at Microsoft it doesn't mean my answer is wrong.
– thelem
Jan 8 '16 at 10:41





I agree with you @thelem
– Casey
Mar 27 '17 at 19:42



Maybe I showed up late to this one.



I use TortoiseGit for this... It works really well and can work alongside Visual Studio as it is just an explorer plugin.



https://tortoisegit.org/





This is the solution of choice for GUI stashing.
– Robino
Jul 22 '15 at 8:45






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

wVEe J D,56OHkk M,7zvkmnIRo2mv5AQzwZwmobQO17
IkPn92lERbuM,6FD,m9GTyG,nI15bgObI,SHm K7QbE,wVSXHFvxrKYHOnAV7ZbFBXEqtUlzHzV31rB1,Lg15

Popular posts from this blog

Keycloak server returning user_not_found error when user is already imported with LDAP

PHP parse/syntax errors; and how to solve them?

Using generate_series in ecto and passing a value