Repository navigation
Description
What feature or improvement do you think would benefit Files?
Currently, the Git integration in Files only supports authentication over the HTTPS protocol, primarily using GitHub Personal Access Tokens (PATs) obtained via an OAuth login flow.
This means that any repository that has been cloned using an SSH URL (e.g., git@github.com:user/repo.git) cannot perform authenticated network operations like pull, push, or fetch. These operations fail because the application is unable to provide the SSH key credentials required by the Git remote.
This is a significant limitation for developers who prefer using SSH for its security and convenience, effectively preventing them from using the integrated Git features for their existing projects.
Requirements
I propose to implement full authentication support for the SSH protocol. This would involve the following key changes, primarily within the GitHelpers.cs file:
- Enhance the
CredentialsProvider: The existingCredentialsProvidercallback will be updated to intelligently handle different credential requests fromLibGit2Sharp. - Detect SSH Requests: The handler will now check if the required credential type is
SupportedCredentialTypes.SshKey. - Provide SSH Key Credentials: When an SSH key is requested, the handler will locate the user's default SSH private key (e.g., ~/.ssh/id_rsa).
- Support for Passphrases: If the private key is encrypted with a passphrase, a ContentDialog will be displayed, securely prompting the user to enter it.
- Complete Authentication: The key path and the (optional) passphrase will be used to create and return an
SshUserKeyCredentialsobject, allowing the SSH authentication to succeed.
This solution would seamlessly enable SSH support while retaining the existing functionality for HTTPS authentication.
Files Version
4.0.11.0
Windows Version
10.0.26100.6584
Comments
Adding SSH support would significantly enhance the Git functionality in Files.
I have already spent time investigating the codebase and have a clear implementation plan. I am willing to contribute the code for this feature and submit a Pull Request.
Before I begin development, I wanted to open this issue to discuss the plan with the project maintainers. I would greatly appreciate any feedback or guidance on this approach.
Thank you in advance!
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fields🔖 Ready to build
Activity
yair100 commentedon Sep 28, 2025
@NyanHeart thanks for reaching out! This proposal looks great to me. I'll wait a couple of days to see if @heftymouse or @ferrariofilippo have any suggestions, but otherwise, we can proceed.
ferrariofilippo commentedon Sep 29, 2025
Sounds good to me!
Only thing I can think of is: if you're adding any url validation, don't make it too tight so that you can support even #14453
BTW if you need any help, feel free to reach out ;)
NyanHeart commentedon Oct 18, 2025
Hi @yaira2 @ferrariofilippo
Here's a update. I've got the basic SSH connection working.
LibGit2Sharp's SSH functionality is provided through the system'sOpenSSH. This works well for keys without a passphrase, as it automatically finds and uses the keys located in the user's~/.sshdirectory.The main challenge I've run into is handling private keys that are protected by a passphrase.
In my testing with a console app,
OpenSSHcorrectly falls back to a terminal prompt, allowing me to enter the passphrase, and the fetch operation succeeds. However, this kind of interactive terminal prompt is obviously not a suitable user experience for a GUI application like Files. We can't have a console window suddenly appearing to ask for a password.I'm currently stuck on finding a good way to programmatically handle this passphrase prompt so that we could display a proper dialog within the
FilesUI instead.Just wanted to share where things stand and open the floor for any ideas or suggestions you might have on how to tackle this.
yair100 commentedon Nov 9, 2025
@NyanHeart thank you for the update.
Feature: Enhanced Git Support (SSH Agent & Status Center) (files-comm…
Feature: Enhanced Git Support (SSH Agent & Status Center) (files-comm…
tynorton commentedon Oct 29, 2026
Running into this currently.
Could we implement it in two phases if we already have passwordless keys working? That first phase would unlock me.