Also see my Run Powershell.
My attempt is to implement the following work flow
D:\Projects
to open the context menu.I added this in registry
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Folder\shell\git-clone]
@="Clone here"
[HKEY_CLASSES_ROOT\Folder\shell\git-clone\command]
@="Powershell -NoProfile -Command \"git clone $(Get-Clipboard)\""
This does add a "Clone here" to the context menu and it clones but not in the directory right clicked but its parent directory.
How would I clone the repo in the directory right clicked?
Thanks to @keithmiller tip I found the solution
The command that works is
Powershell -NoProfile -Command "Set-Location -LiteralPath '%V' ; git clone $(Get-Clipboard)"
And the registry entry can be created with the following .reg
file:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\git-clone]
@="Clone here"
[HKEY_CLASSES_ROOT\Directory\shell\git-clone\command]
@="Powershell -NoProfile -Command \"Set-Location -LiteralPath '%V' ; git clone $(Get-Clipboard)\""
I use Directory branch instead of Folder here as it probably only works in real file directories.