libgit2 / libgit2sharp

Git + .NET = ❤
http://libgit2.github.com
MIT License
3.15k stars 887 forks source link

"unsupported url protocol" when trying to go a pull #1948

Open walteralmeida opened 2 years ago

walteralmeida commented 2 years ago

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

lcmohale commented 2 years ago

Did this issue manage to get resolved!?

Getting the same error, when doing push to remote