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 9257467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:10:10+00:00 2026-06-18T12:10:10+00:00

I am using libgit2sharp to on a proof of concept to automate fetching, changing,

  • 0

I am using libgit2sharp to on a proof of concept to automate fetching, changing, commiting some files, and pushing to a remote origin.

I know that push is still not finished yet, but fetch is in vnext but when I call it:

An error was raised by libgit2. Category = Os (Error).
Failed to connect to host

Here is my code:

        using (var repo = new Repository(gitPath))
        {
            var allBranches = repo.Branches.ToList(); //works fine

            var creds = new Credentials() {Username = username, Password = password};
            var remote = repo.Remotes.FirstOrDefault(x => x.Name == "origin");
            remote.Fetch(credentials:creds);  //blows up here     


        }

Some other details:

  1. My remote is private bitbucket hosted using https. (looks like: https://myusername@bitbucket.org/myRepoOwner/repoName.git)
  2. I am able to fetch and push from the command line, so the repo is working.
  3. The same issue happens when I use repo.Fetch(“origin”);
  • 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-18T12:10:11+00:00Added an answer on June 18, 2026 at 12:10 pm

    This sounds like an issue that was recently fixed in libgit2 (and likely has not yet been integrated into libgit2sharp.)

    In the mean time, you should be able to remove the myusername@ from your remote URI to work around this problem, eg https://bitbucket.org/myRepoOwner/repoName.git.

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

Sidebar

Related Questions

I'm using libgit2sharp and I'd like to get a Commit object representing something like
Using Location.getBearing(); I seem to get randomly changing bearings. Aka, I can turn the
Using ASIHTTPRequest, I downloaded a zip file containing a folder with several audio files.
Using Yii MVC, I want to know when a user is still on my
Using Trigger.io's barcode api in an application that only contains boilerplate HTML and the
I've been trying to change the working directory using libgit2sharp and so far I
Using this as an example, how could I scale the graphic such that it's
Using ember 1.0.0-pre3 I have a little app that has this code: window.App =
Using a form I am adding some basic fields to my table. I also
Using Visual Studio / C#, I've been debugging some nunit tests recently, and am

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.