RickStrahl / MarkdownMonster

An extensible Markdown Editor, Viewer and Weblog Publisher for Windows
https://markdownmonster.west-wind.com
Other
1.59k stars 235 forks source link

[FEAT} Option to use ssh for cloning #1144

Closed pa-0 closed 2 weeks ago

pa-0 commented 3 weeks ago

Please consider offering the option to use SSH authentication to clone remote repositories.

Some (possibly unneccessary) context:

With git/ssh, multiple accounts can be managed easily either by 'telling' git to choose which account with which to authenticate based on directory patterns, e.g., [INCLUDEIF gitdir:] in .gitconfig. Alternatively, in the ssh config file, host aliases can be set, so to clone from account A (or account B). Both of these workflows are pretty commonly used to juggle authentication for multiple users/remote hosts. With the latter, I can do the following:

account A:

git clone ssh:alpha OWNER/REPO 

account B:

git clone ssh:bravo OWNER/REPO

In Markdown Monster

Attempting to clone a private repository from account B returns: image

This wouldn't be the case if we were able to use SSH, or alternatively, even being able to send custom git commands to clone.

RickStrahl commented 2 weeks ago

Can't you externally clone, and then once connected shouldn't all other commands work?

You can shell to terminal or use the Open in External Git Client from most context menus, clone and once connected you should just be able to use other commands?

RickStrahl commented 2 weeks ago

Off the top of my head I'm not sure if SSH wouldn't just work, since this particular command is piped through the Command line. But you need to give it an SSH address not hte HTTPS address.

I don't use SSH so not familar with it to be honest but should you be using something like:

git@host:username/repository.git

for the 'url'.

MM basically executes this:

ExecuteGitCommand($"clone {gitUrl} \"{localPath}\"{cloneDepth}",
pa-0 commented 2 weeks ago

Oh ok! Will give it a try. Thanks.

pa-0 commented 2 weeks ago

So using the built in tool to clone a remote repo via ssh did not workf or me BUT on your other suggestion, I tried cloning the remote locally first via terminal and then committing using the in-app git tool and that works without a hitch, so I am closing this.

On another note, in case anyone else looking for help/ideas finds this issue, the developers of GitJournal (another notes app I believe) released this nifty Go tool called git-auto-sync which complements MarkdownMonster (or any note-taking tool) very well for anyone who wants to keep their notes synced with git automatically. It's a small (~7MB), portable, single-file executable with a pretty simple setup.