Skip to content

Feature: Use installed git.exe instead of libgit2 #16738

Open

Description

@heftymouse

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
  • Add configuration options

Files Version

3.8.13

Windows Version

10.0.27774.1000

Comments

No response

Activity

  1. Lamparter commented on Jan 26, 2025

    @Lamparter
    Contributor

    I wrote just the thing for this!
    Might need a bit more work, but it's a start.

  2. 0x5bfa commented on Jan 26, 2025

    @0x5bfa
    Member

    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.

    public static class GitRepositoryFactory
    {
        private Dictionary<string, GitRepository> lookupTable = [];
    
        public GitRepository? GetOrCreate(string path) {}
    }
    public partial sealed class GitRepository : IDisposable
    {
        public GitRepository(string rootPath) {} // 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.

  3. moved this from 🆕 New to 📋 Planning stage in Files task boardon Jan 26, 2025
  4. Lamparter commented on Jan 7, 2026

    @Lamparter
    Contributor

    @yaira2 what do you think?
    I have a working IGitService implementation that I can implement here quite easily if you like.

  5. yair100 commented on Jan 7, 2026

    @yair100
    Member

    @yaira2 what do you think? I have a working IGitService implementation that I can implement here quite easily if you like.

    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.

  6. Lamparter commented on Jan 10, 2026

    @Lamparter
    Contributor

    @yaira2 sure, but is it still something you'd like to move forward with?

  7. yair100 commented on Jan 11, 2026

    @yair100
    Member

    We can move forward with the interface. Please let me know before doing anything beyond that🙂

  8. Lamparter commented on Apr 27, 2026

    @Lamparter
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area - gitFeatures or bug reports relating to git

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions