You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature: Use installed git.exe instead of libgit2 #16738
What feature or improvement do you think would benefit Files?
Having this as an option would allow Files to easily support the full range of Git features, including automatically respecting the user's Git settings, using any authentication methods they have already configured, and pushing to ssh remotes. This is a fairly common way of implementing Git support, seen in software like vscode. Files can fall back to libgit2 for basic support if Git is not already installed (unlikely on a developer's machine)
Requirements
Introduce an IGitService abstraction and refactor the existing GitHelpers implementation to use it
Implement existing Git operations through git.exe and use this implementation if git.exe is found
I remember someone told me porcelain is better, perhaps you, and I think this is a good idea. Here's my thoughts:
I have been thinking about this being a standalone class like below and I think this would be instantiated through GitRepositoryFactory static class (e.g. GetOrCreate()) to retrieve one identical instance per the same git repo among tabs, panes and windows. This way prevents us from putting string path in each method.
publicpartialsealedclassGitRepository:IDisposable{publicGitRepository(stringrootPath){}// Ideally, not string but IFolder in the future.}
I still haven't evaluate how difficult this is and how suitable this is so I can't say which is better for now but IGitRepositorySevice would work in this current codebase and be easier.
Activity
Lamparter commentedon Jan 26, 2025
I wrote just the thing for this!
Might need a bit more work, but it's a start.
0x5bfa commentedon Jan 26, 2025
I remember someone told me porcelain is better, perhaps you, and I think this is a good idea. Here's my thoughts:
I have been thinking about this being a standalone class like below and I think this would be instantiated through GitRepositoryFactory static class (e.g.
GetOrCreate()) to retrieve one identical instance per the same git repo among tabs, panes and windows. This way prevents us from puttingstring pathin each method.I still haven't evaluate how difficult this is and how suitable this is so I can't say which is better for now but IGitRepositorySevice would work in this current codebase and be easier.
Lamparter commentedon Jan 7, 2026
@yaira2 what do you think?
I have a working
IGitServiceimplementation that I can implement here quite easily if you like.yair100 commentedon Jan 7, 2026
I'm not sure we'll be able to copy directly from the project you linked, since we have different method names, but the idea sounds good.
Lamparter commentedon Jan 10, 2026
@yaira2 sure, but is it still something you'd like to move forward with?
yair100 commentedon Jan 11, 2026
We can move forward with the interface. Please let me know before doing anything beyond that🙂
Lamparter commentedon Apr 27, 2026
Roadmap for migrating
GitHelpersto a DI serviceGetGitRepositoryPathCode Quality: MovedGetGitRepositoryPathoperation into Git abstraction #18435GetOriginRepositoryNameCode Quality: MovedGetOriginRepositoryNameoperation into Git abstraction #18438GetBranchesNamesCode Quality: MovedGetBranchNamesoperation into Git abstraction #18440GetRepositoryHeadCode Quality: MovedGetRepositoryHeadoperation into Git abstraction #18505CheckoutCode Quality: MovedCheckoutoperation into Git abstraction #18669CreateNewBranchAsyncCode Quality: MovedCreateNewBranchAsyncoperation into Git abstraction #18724DeleteBranchAsyncCode Quality: MovedDeleteBranchAsyncoperation into Git abstraction #18726ValidateBranchNameForRepositoryCode Quality: MovedValidateBranchNameForRepositoryoperation into Git abstraction #18727FetchOriginPullOriginAsyncPushToOriginAsyncRequireGitAuthenticationAsyncIsRepositoryExGetGitInformationForItemRemoveSavedCredentialsGetSavedCredentialsInitializeRepositoryAsyncGetRepoInfoIsValidRepoUrlCloneRepoAsyncFix: Fixed an issue where private repos could not be cloned #18734IVersionControl#18040IsExecutingGitActionet al. Code Quality: Refactored LibGit2 integration as a DI service for future-proofing #18679