3

I can't find the Stashes (nor REMOTES, BRANCHES, FILE HISTORY) menu in the Source Control (the one you open up with Ctrl-Shift-U) tool bar.

This is how my Visual Studio Code looks like:

enter image description here

And this is a picture I found on the web with the menu options I'd like to restore:

enter image description here

I couldn't find an option to restore these menu options.


it seems like somehow GitLens, instead of replacing the Source Control panel, add his own:

enter image description here

opensas
  • 60,462
  • 79
  • 252
  • 386
  • 1
    You could also take this as an opportunity to ditch `stash` all together and instead temporary check in code as proper commits instead. Assuming an alias `ci` for commit then `git stash push` = `git ci -am ci" and `git stash pop` = `git reset HEAD^ # when on the branch where the ci commit was made`. Your life will be so much better if everything is just ordinary commits. [torek](https://stackoverflow.com/a/27117335/23118) also recommends not using `stash` and I am quite sure I've seen VonC do as well, but I did not find a reference now. – hlovdal Oct 18 '22 at 23:09
  • so, what you mean is to basically commit everything as 'tmp' and then undo commit and unstage changes, right? is there any disadvantage of such approach (if I push it to a feature branch I might get conflicts after rolling back, right?) – opensas Jun 02 '23 at 12:31
  • 1
    More or less. There are no disadvantages, [and there are many benefits](https://stackoverflow.com/a/75010635/23118). If you get conflicts then you get those independently of using commits or stash, however having conflicts on commits is much better (it allows for instance using [git imerge](https://github.com/mhagger/git-imerge) to resolve those). – hlovdal Jun 02 '23 at 13:57

3 Answers3

5

You need to install (or enable if you have it disabled) the GitLens extension. That is what adds those sub-sections seen in your second screenshot.

Alternatively, if you click the ellipsis that is to the right of each of your repositories, you should see a "Stash" menu item that should also meet most of your needs.

Note that the GitLens extension is apart of the Git Extension Pack extension, which contains a few other extensions as well (including Git History, which you appear to have already).

Timothy G.
  • 6,335
  • 7
  • 30
  • 46
  • 1
    thanks a lot, I had gitlens installed, but it seems like it adds another source control item in the toolbar, and I was looking at the original one, I guess – opensas Oct 18 '22 at 13:31
  • 2
    @opensas it _should_ modify the built-in source control tab (it does for me at least, its the icon that's 3rd from the top in your toolbar in your first screenshot). GitLens does add a new icon to the toolbar (in your first screenshot, its the second from the bottom one), but for me, that tool only seems to contain information about GitLens. – Timothy G. Oct 18 '22 at 13:36
1

Just for reference, in case anybody else stumbles upon this issue.

I created this issue at GitLens github repo and the solution was to right click on the original 'Source Control' icon and select the option "Reset location"

It seems it's not the first time that something like this happened.

opensas
  • 60,462
  • 79
  • 252
  • 386
1

If you go into GitLens, drag the Stash section to the sidebar underneath the Source Control, it will create an icon. You can then open up Source Control and drag that icon into it.