Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub clone to desktop uses TortoiseGit instead of GitHub Desktop

When i try to clone a repository to desktop the default app for cloning has suddenly became TortoiseGit instead of GitHub. Anyone with a fix?

github-tortoise

like image 768
Nomik Avatar asked Oct 10 '18 18:10

Nomik


People also ask

Can we use TortoiseGit for GitHub?

Use the TortoiseGit Puttykey generator to create a new keypair add your public key to GitHub. Clone/create a new repository. In thee Tortoise repository settings, set your fullname and email. Then in remote menu under the Git configuration menu enter your clone URL and select your PuTTY key.

Is GitHub desktop different than GitHub?

GitHub Desktop is an application that enables GUI-based interaction with GitHub. Git provides a wide range of commands for Git activities like creating repositories, commits, pull requests, and so on. However, GitHub desktop provides GUI-based those activities using best practices with Git and GitHub.

Can I use GitHub desktop instead of Git?

You can use GitHub Desktop to complete most Git commands from your desktop with visual confirmation of changes. You can push to, pull from, and clone remote repositories with GitHub Desktop, and use collaborative tools such as attributing commits and creating pull requests.


2 Answers

The following fix is a permanent solution for this issue that also withstands TortoisGit-updates/repairs.

It adds GitHubDesktop's protocol-associations the way described in https://docs.microsoft.com/en-us/windows/win32/shell/default-programs.

Add to the registry (You can save this content as .reg file and double-click it to auto-import these keys into registry):

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\GitHubDesktop]

[HKEY_LOCAL_MACHINE\SOFTWARE\GitHubDesktop\Capabilities]

[HKEY_LOCAL_MACHINE\SOFTWARE\GitHubDesktop\Capabilities\UrlAssociations]
"github-windows"="github-windows"
"x-github-client"="x-github-client"

[HKEY_LOCAL_MACHINE\SOFTWARE\RegisteredApplications]
"GitHubDesktop"="Software\\GitHubDesktop\\Capabilities"

Reboot or on a windows-server sign-out and log-in.

The next time a project is cloned from github, a message-box popped-up asking to pick an app.

GitHubDesktop will now also be available in the Windows settings: Choose default apps by protocol. So it can be recovered with Windows settings, if TortoisGit (or another app) was chosen as default handler for GitHub-clone.

I also opened a new error at GitHubDesktop-development: https://github.com/desktop/desktop/issues/8258

like image 191
tobias.loew Avatar answered Dec 10 '22 16:12

tobias.loew


There was a bug in 2.6.0 which made TortoiseGit the default if the github handler was enabled on installation.

To fix this, go to the default programs settings in Windows, open the file-type associations dialog and set github-windows and x-github-client back to the official github client. Maybe you have to update to TortoiseGit 2.7.0 first.

cf. https://www.thewindowsclub.com/change-file-associations-windows


You could try whether the hard way works: (Store this as a .reg file and import it, you need to madjust the paths)

Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\github-windows]

[HKEY_CLASSES_ROOT\github-windows]
"URL Protocol"=""
@="URL:github-windows"

[HKEY_CLASSES_ROOT\github-windows\shell\open\command]
@="\"C:\\Users\\USERNAME\\AppData\\Local\\GitHubDesktop\\app-1.4.2\\GitHubDesktop.exe\" --protocol-launcher \"%1\""

[-HKEY_CLASSES_ROOT\x-github-client]

[HKEY_CLASSES_ROOT\x-github-client]
"URL Protocol"=""
@="URL:x-github-client"

[HKEY_CLASSES_ROOT\x-github-client\shell\open\command]
@="\"C:\\Users\\USERNAME\\AppData\\Local\\GitHubDesktop\\app-1.4.2\\GitHubDesktop.exe\" --protocol-launcher \"%1\""
like image 25
MrTux Avatar answered Dec 10 '22 16:12

MrTux