I am curious to how the button works. Can you explain how when I click the "Clone in Windows" button it knows to open a local application(GitHub) on my machine.
Cloning allows you to create a 1-to-1 copy of your hard drive, which is useful when you need to backup or transfer data. Even better, it also allows you to copy over your Windows 10 installation with your preferences and settings completely intact.
Cloning a hard drive can avoid the process of time-consuming reinstall the system and reconfigure settings. And cloning is very safe, it plays a significant role in managing and protecting data. The best way to clone a hard drive to SSD is to seek the help of third-party software.
Look at this patch of GitExtension: it register that action in HKCR
<Component Id="Protocol.github_windows" Guid="*">
<RegistryKey Key="github-windows" Root="HKCR">
<RegistryValue Value="URL: Github for Windows Protocol" Type="string" />
<RegistryValue Name="URL Protocol" Value="" Type="string" />
</RegistryKey>
<RegistryKey Key="github-windows\DefaultIcon" Root="HKCR">
<RegistryValue Value="[INSTALLDIR]GitExtensions.exe" Type="string" />
</RegistryKey>
<RegistryKey Root="HKCR" Key="github-windows\shell"/>
<RegistryKey Root="HKCR" Key="github-windows\shell\open"/>
<RegistryKey Root="HKCR" Key="github-windows\shell\open\command">
<RegistryValue Value=""[INSTALLDIR]GitExtensions.exe" %1" Type="string" />
</RegistryKey>
</Component>
And it adds:
if (args[1].StartsWith("git://"))
{
args = new string[]{args[0], "clone", args[1]};
}
if (args[1].StartsWith("github-windows://openRepo/"))
{
args = new string[]{args[0], "clone", args[1].Replace("github-windows://openRepo/", "")};
}
GitHub for Windows would go for a similar approach.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With