![]() Stashing takes the messy state of the working directory and saves it on a stack of unfinished changes that you can. Solution Read here to learn more about git stash operations: A mercurial equivalent of Stash is called Shelve: If a mercurial repository is opened in SourceTree, the function will appear as Shelve instead of git's Stash. Is there a way (preferably on vs code, but also command line) to 're-stash' the changes (if any - in my case I did not change anything) to the same stash Like so I would avoid the creation of a new stash, identical to the current one that I already have. This is possible with the git stash command. For that, on VS code ( gitlens extension enabled) I clicked on apply stash, which I believe is similar to git stash apply now, if I am finished with my changes (or I did not change script.py at all), it appears I need to create a new stash, with a new ID in order to checkout back to the (unchanged) master branch Heres a simple example of how to use the git stash command. I now want to go back to branch HL and keep working on that stashed change. Call the git stash pop command at any point to apply the shelved files. ![]() On the one hand, the command can be used to undo the effects of git add and unstage changes you have previously added to the Staging Area. If I now do git stash list I get WIP on HL: 710c540 rm cached files not to track The 'restore' command helps to unstage or even discard uncommitted local changes. So, on the new HL (the real name is somewhat longer - please see screenshot below) branch that I created from master, I modified script.py and, as the production version of my python script is still on the master branch and I stashed the changes and it is all fine, I can checkout back to master. However, I am not yet ready to commit the changes. To stash your changes: First, there has to be a change done to a file. ![]() I have created a branch to make some changes on script.py. If a mercurial repository is opened in SourceTree, the function will appear as Shelve instead of gits Stash. I am using git to track changes on some python scripts. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |