I've had git running on my machine for over a year. I have a folder in my C root called gitRepo, which contains all my various repos. For some reason, for one repo only, the git bash command is suddenly missing from the right-click context menu. Here's a screenshot from a working repo:
And here's the "non-working" repo:
The git bash command is missing from the non-working one. (Yes, I know I can open a bash window from the working one, and then just use cd ../ to change directories so I'm in the correct repo, but that's just asking for trouble, as I frequently have bash windows open for multiple repos.)
What isn't visible in the screenshot is that the entire top menu chunk (Open - Play with VLC media player) is also missing from the "bad" repo; the only item available in that top chunk is 7-Zip.
What could have caused this, and how do I get the entry back?
5 Answers
Even if the context menu is working correctly otherwise, it doesn't appear if you go to a folder via your "Library" in Windows. So when doing that, use a direct path from C:\ onwards instead.
3This may not be an option for everyone, but here's what finally worked for me. Since I knew that newly-created folders would have the correct context menu, I just renamed the "bad" repo (just to be safe), then created a new clone of the remote repo, which by default creates a new folder. Once I knew that the new repo was working, I deleted the old folder.
The standard trick for these kinds of problems on windows is to completely remove and reinstall the software in question.
If that doesn't help, according to this page folders can have different context menus based on their folder template.
Have a look at the "Folder Options" dialog for the working and non-working folders. Check for differences.
You might need to dive into the registry to see if the "shell extensions" in question have been disabled for some kind of folders.
4If you are coming here to get Ubuntu for Windows bash in context menu, it's simple as this registry file:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\Background\shell\Bash]
@="Open in Bash"
[HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\Background\shell\Bash\command]
@="\"bash\""There is no command line arguments to worry about, because bash starts in the working (mounted) directory.
Above only works for right clicks on empty area at the explorer window. (For a right clicking in a Folder item I haven't found a good way cause the working directory is not set there.)
For me only a re-installation helped. I couldn't find the Registry keys mentioned in the other post.