Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8893597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:17:14+00:00 2026-06-14T23:17:14+00:00

I am trying to clone a git repository from the local file system: using

  • 0

I am trying to clone a git repository from the local file system:

using System;
using LibGit2Sharp;

class Program
{
    static void Main()
    {
        var sourceUrl = @"file:///c:/work/libgit2sharp";
        using (Repository.Clone(sourceUrl, "targetDir", bare: true))
        {
            Console.WriteLine("repository successfully cloned");
        }
    }
}

and I get an exception:

Unhandled Exception: LibGit2Sharp.LibGit2SharpException: An error was raised by libgit2. Category = Odb (Error).
Failed to find the memory window file to deregister
   at LibGit2Sharp.Core.Ensure.Success(Int32 result, Boolean allowPositiveResult) in c:\work\libgit2sharp\LibGit2Sharp\Core\Ensure.cs:line 85
   at LibGit2Sharp.Core.Proxy.git_clone_bare(String url, String workdir, git_transfer_progress_callback transfer_cb) in c:\work\libgit2sharp\LibGit2Sharp\Core\Proxy.cs:line 219
   at LibGit2Sharp.Repository.Clone(String sourceUrl, String workdirPath, Boolean bare, Boolean checkout, TransferProgressHandler onTransferProgress, CheckoutProgressHandler onCheckoutProgress) in c:\work\libgit2sharp\LibGit2Sharp\Repository.cs:line 431
   at Program.Main() in c:\work\ConsoleApplication1\Program.cs:line 10

I’ve also tried the following source url:

var sourceUrl = @"c:\work\libgit2sharp\.git\";

and got another exception:

Unhandled Exception: LibGit2Sharp.LibGit2SharpException: An error was raised by libgit2. Category = Config (Error).
Failed to parse config file: Unexpected end of file while parsing multine var (in c:/work/ConsoleApplication1/bin/Debug/targetDir/config:23, column 0)
   at LibGit2Sharp.Core.Ensure.Success(Int32 result, Boolean allowPositiveResult) in c:\work\libgit2sharp\LibGit2Sharp\Core\Ensure.cs:line 85
   at LibGit2Sharp.Core.Proxy.git_clone_bare(String url, String workdir, git_transfer_progress_callback transfer_cb) in c:\work\libgit2sharp\LibGit2Sharp\Core\Proxy.cs:line 219
   at LibGit2Sharp.Repository.Clone(String sourceUrl, String workdirPath, Boolean bare, Boolean checkout, TransferProgressHandler onTransferProgress, CheckoutProgressHandler onCheckoutProgress) in c:\work\libgit2sharp\LibGit2Sharp\Repository.cs:line 431
   at Program.Main() in c:\work\ConsoleApplication1\Program.cs:line 12

targetDir is never created.

If on the other hand I use HTTP transport, the Repository.Clone method works fine:

var sourceUrl = "https://github.com/libgit2/libgit2sharp";

So my question is if I am doing something wrong or if this is unsupported feature or a bug in the native git2.dll?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T23:17:15+00:00Added an answer on June 14, 2026 at 11:17 pm

    So my question is if I am doing something wrong or if this is unsupported feature or a bug in the native git2.dll?

    A bit a both, actually.

    • The first exception is clearly a bug. This should not happen and will be troubleshot.
    • The second one requires a deeper analysis. Would you be so kind as to open a issue in the LibGit2Sharp project?

    Good news are that a pull request from BenStraub was recently merged. This pull request implements the local fetch transport which should pretty solve the issue.

    LibGit2Sharp will be updated in the following days with a new a new version of libgit2 binaries which should allow you perform a local clone/fetch. I’ll update this answer as soon as it’s been done.

    Update

    This test shows how do to a Clone and a Push over against a local repository.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(Using Vista)I'm trying to clone an app from my GitHub Repository and push it
I'm trying to use git to clone an svn repository with std layout (using
I'm trying to clone a repository using ssh. From the command line it works
When trying to clone ANY repository via https from github, we get: git clone
I'm trying to clone a git repository from a certain date. Even if this
In the code below I am trying to clone a git repository to another
I'm trying to use git on windows to clone a remote repository. I can
I'm getting this strange error message when trying to clone or pull from git.
I'm trying to clone my personal fork on github using the git+ssh protocol with
I am trying to clone a repo to my laptop from my main PC.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.