-
Notifications
You must be signed in to change notification settings - Fork 893
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
How to fetch/pull using SSH #2135
Comments
I'm not really sure what you're looking for here. There's nothing special that LibGit2Sharp requires to use SSH. If your command-line git client works with SSH, then so should LibGit2Sharp. If you need guidance on how to do that, you should check out https://docs.github.com/en/authentication/connecting-to-github-with-ssh |
Hmm, but all the example on the wiki require a username and password to make the fetch/pull actions and I would like to avoid needing to use the username and password, maybe I'm just not knowing how to use the lib. |
As I said before, there's literally nothing special to do:
If you already have your SSH keys set up, it just works. |
Hmm, but what about the pull and fetch operation that according to the wiki would require a username and password?
or I can just ignore the credential provider? And pass an "empty" fetchOption? I was assuming that everything in the sample was mandatory. |
You don't have to specify credentials. |
Hey, thanks for the help, it worked. Out of my curiosity, when I execute the pull command a terminal flashes for a second, is there a way to prevent it from appearing? Or is this a side effect of how the Commands work under the hood? |
What sort of application are you using LibGit2Sharp from? |
I'm using it from a Godot application, but the issue appears to be exclusive to Widows, the terminal that appears seems to be related with OpenSSH. When I run the app and do the same Commands.Pull but on Linux the terminal window does not flashes. |
Good question. I think that you could rebuild libgit2 with libssh2, but that's a parcel of other problems that you would have to deal with. I can investigate the windows side. There are various exec options and some of them open windows, so we might be able to suppress it. But we'd really need to know that it shouldn't prompt for a key phrase. (It's also possible that something in the openssh realm is opening the window, not us.) 😵💫 I can investigate a bit on the |
Hey thanks for the help, I was just curious about the terminal flashing, but it is not a deal breaker for me. I will close the issue because the original problem already has been solved. |
You are opening a bug report against the LibGit2Sharp project: we
use GitHub Issues for tracking bug reports and feature requests. If
you have a question about an API or usage, please ask on StackOverflow:
http://stackoverflow.com/questions/tagged/libgit2sharp.
Otherwise, to report a bug, please fill out the reproduction steps
(below) and delete these introductory paragraphs. Thanks!
Reproduction steps
Create a project and try and fetch/pull using the OS configured SSH.
I tried asking it on stack overflow, but let's say that they were not very receptive with my question, so here I am.
Expected behavior
Have some sort of documentation or sample teaching how to use the OS ssh key to make execute certain operations. When I look at the fetch/pull wiki(last update 2018) there is no mention on how to use the SSH, since github and some other platforms don't accept the old username and password authentication this should be more easy to access.
https://github.com/libgit2/libgit2sharp/wiki/git-pull
https://github.com/libgit2/libgit2sharp/wiki/git-fetch
Actual behavior
Version of LibGit2Sharp (release number or SHA1)
0.31.0
Operating system(s) tested; .NET runtime tested
Windows, .NET 9
The text was updated successfully, but these errors were encountered: