libgit2 / libgit2/libgit2sharp

"unsupported url protocol" when trying to go a pull

Open
#1,948 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
3.5k
Forks
925
PR merge metrics
No merged PRs in 30d

Description

I am trying to do a pull, using the documented code :

		using (var repo = new Repository(folder))
		{
			// Credential information to fetch
			LibGit2Sharp.PullOptions options = new LibGit2Sharp.PullOptions();
			
			options.FetchOptions = new FetchOptions();
			options.FetchOptions.CredentialsProvider = new CredentialsHandler(
				(url, usernameFromUrl, types) =>
					new UsernamePasswordCredentials()
					{
						Username = EMAIL,
						Password = PASSWORD
					});
			
			// Pull
			Commands.Pull(repo, new LibGit2Sharp.Signature(USERNAME, EMAIL, new DateTimeOffset(DateTime.Now)), options);
		}

And I am getting an "unsupported url protocol"

I made sure that we are using https protocol by adding this to the git config :

[url "https://github.com/"]
insteadOf = git@github.com:
[url "https://"]
insteadOf = git://

Am I missing something ?

Thank you

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the documented Pull example in the issue with the shown git config URL rewrites and capture the exact failing URL or protocol. Compare the configured remote URL and the rewritten form; done means the pull completes without the unsupported URL protocol error.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, git
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.