Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a File Explorer context menu entry to launch Desktop #5373

Open
darkred opened this issue Aug 10, 2018 · 15 comments
Open

Add a File Explorer context menu entry to launch Desktop #5373

darkred opened this issue Aug 10, 2018 · 15 comments
Labels
user-research Issues that might benefit from user interviews, validations, and/or usability testing windows Issues specific Desktop usage on Windows

Comments

@darkred
Copy link

darkred commented Aug 10, 2018

Using GitHub Desktop 1.3.2 x64 in win 10.

Currently in order to add a repo to GitHub Desktop
you have to either use the dialogs: File|New Repository or File|Open Local Repository
or drag'n'drop a repo folder inside GitHub Desktop.

My suggestion is to add a File Explorer context menu entry, named e.g. GitHub Desktop Here.
This would:

  • open an existing repo (if the opened folder is a repo), or
  • offer a dialog to create a repo with the opened folder, otherwise.

For reference, Git for Windows offers similar context menu entries: "Git GUI Here" and "Git Bash Here" and I find them very useful:
2018-08-10_203801
2021-07-15_162421~

@shiftkey shiftkey added the windows Issues specific Desktop usage on Windows label Aug 10, 2018
@shiftkey
Copy link
Member

For reference, Git for Windows does this by adding registry entries at install time (if the user has enabled it). Here's the source, so you can see what changes need to be made: https://github.com/git-for-windows/build-extra/blob/master/installer/install.iss#L2079-L2112

I'd love to wrap my head around how much interest there is in this feature, as our installer doesn't support the ability to let users opt-in for features like this, so we'd need to have a different UX for enabling it. This is also a Windows-specific feature, although there might be similar ways to do this in other OSes that I haven't looked into yet.

@shiftkey shiftkey added the user-research Issues that might benefit from user interviews, validations, and/or usability testing label Aug 13, 2018
@billygriffin
Copy link
Contributor

Thanks! So I understand this a bit better, is the concept to essentially:

  1. Find a folder you might want to use GitHub Desktop with and right click on it.
  2. The context menu pops up with all the normal options in addition to one that says something like "Open in GitHub Desktop" or "GitHub Desktop Here"
  3. When you click on it, it either opens the existing repo or pops the dialog to create a new one with the selected folder path.

Is that correct?

@darkred
Copy link
Author

darkred commented Aug 13, 2018

Yes, exactly that.

@shiftkey shiftkey changed the title (Feature request) Add a File Explorer context menu entry, e.g. "GitHub Desktop Here" Add a File Explorer context menu entry to launch Desktop Aug 14, 2018
@Ciantic
Copy link

Ciantic commented Jan 18, 2019

Adding that shortcut there is easy, but you need to add a command line argument to GH Desktop e.g. GitHubDesktop.exe --open-repo C:\Source\my-repo that opens a given repo in the GH Desktop. And maybe: If there is no repo there, GH desktop could suggest creating one, or cloning from a url to there!

I want this too, I'd like to replace TortoiseGit with an app, that I can just open a repo folder.

I don't care about adding repos inside Github Desktop, there is so many, that it's just clumsy. I just want to open each repo from the folder I browse in explorer.

Here is the Registry editor snippet stolen from Open with VSCode for reference, once you have created the command line argument:

Windows Registry Editor Version 5.00

; Right click on explorer TREE
[HKEY_CLASSES_ROOT\Folder\shell\Open with VSCode]
@="Open as VS Code project"
"Icon"=hex(2):43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
  00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,00,\
  4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,56,00,53,00,20,\
  00,43,00,6f,00,64,00,65,00,5c,00,43,00,6f,00,64,00,65,00,2e,00,65,00,78,00,\
  65,00,2c,00,30,00,00,00

[HKEY_CLASSES_ROOT\Folder\shell\Open with VSCode\command]
@="C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe \"%1\""

; Right click on explorer main area
[HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\Background\shell\vscode]
@="Open as VS Code project"
"Icon"="C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe,0"

[HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\Background\shell\vscode\command]
@="\"C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\" \"%V\""

@shiftkey

This comment has been minimized.

@Ciantic

This comment has been minimized.

@heetbeet
Copy link

heetbeet commented Jul 15, 2021

(Edited)
The following scripts will automatically generate a context menu for Windows users (I use it myself for my own purposes).

You can run it directly here:
Add GitHubDesktop context menu.zip
(Edit: rather use this: https://github.com/heetbeet/GitHub-Desktop-context-menu )

Example:

image

@heetbeet
Copy link

heetbeet commented Jul 15, 2021

How about we make an opt-out option that automatically gets added by the installer. We can make this into a cascading menu with an option to opt-out. I think that is what most Windows users would want.

Something like:
image

https://blog.sverrirs.com/2014/05/creating-cascading-menu-items-in.html

@darkred
Copy link
Author

darkred commented Jul 15, 2021

How about we make an opt-out option that automatically gets added by the installer. We can make this into a cascading menu with an option to opt-out. I think that is what most Windows users would want.

Regarding an opt-out option, I disagree: I believe that the user should be able to choose at installation whether he wants the context menu entry, just like e.g. VSCode installer does:

VSCode installer screenshot

2021-07-15_190649

 
Also, regarding having a cascading menu, I am also against it:
I believe that a single GitHub Desktop Here directory context menu entry would suffice.
Having a GitHub Desktop cascading menu just for having a dedicated Remove GitHub Desktop menu entry inside it, would be unneeded and distracting 99% of the times.
The context menu could be removed via a relevant entry in: File | Options | Integrations, or by unticking the relevant checkbox while (re-)running the GitHub Desktop installer (although, currently the installer doesn't offer any options whatsoever).

@heetbeet
Copy link

heetbeet commented Jul 15, 2021

@darkred I see your point, opt-in is probably servicing the user more and the cascading menu would be cumbersome indeed. I don't agree with adding options to the installer. GitHub Desktop has a really nice one-click no-questions installer, I think it should be a high priority to keep it that way.

It would be sane to add it as a setting in File->Options.

The reason I suggested the cascading option is that it would be the easiest way to add this feature without changing anything in the core of the app.

Another option is to add a cascading entry that can be de-cascaded or discarded :
image

@heetbeet
Copy link

Okay, so here is a proof of concept for adding a temporary options menu with a choice to either keep the entry or to discard the entry. I haven't really seen such a pseudo-interactive context menu, but it does check a lot of usability boxes:
https://github.com/heetbeet/GitHub-Desktop-context-menu

For me personally: this is the closest I can get to a fully isolated solution (isolated from the app) that I can immediately start using myself.

For the community: it might be easy to rework this and add it to GitHub Desktop, but I have no idea how to integrate this with the app itself.

What the script does

It adds the necessary actions as scripts in the bin directory, then adds the default setting (the cascading one) to the context manager. You can run any of the three scripts to reset the context manager to that specific state.
image

@iwsfg
Copy link

iwsfg commented Sep 30, 2021

Or rather than building nested context menus it can be made into a checkbox under the Advanced tab in the Options.

This way you can have opt-in, opt-out, allow user to change their mind later, allow marking menu item as Extended (so it only shows up if Shift key is being held) based on user preference and make menu item follow interface languages changes, although I don't see a setting for that anywhere, I guess it's only available in English as of now.

Thanks for the registry hack, heetbeet! Was about to make my own

@steveward
Copy link
Member

Requested in #15205.

@steveward
Copy link
Member

Requested in #17089:

A new entry is added to the explorer context menu to open a folder with GitHub Desktop. (Entry should only be visible if it is in the folder context menu. So if you right-click in an empty field in a folder, not on a file)

When this context menu entry is clicked, GitHub Desktop will check if a .git exists and will open this repository. If it already exists in GitHub Desktop, it will open it, and if not it will "Add existing repository..."

If there is no .git folder, an info text will be displayed.

@ghost
Copy link

ghost commented Jan 17, 2024

Another example would be TortoiseGit. It gives you basically all git commands in the context menu
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user-research Issues that might benefit from user interviews, validations, and/or usability testing windows Issues specific Desktop usage on Windows
Projects
None yet
Development

No branches or pull requests

7 participants