Skip to content

two issues about config remote #1348

@Aimeast

Description

@Aimeast

Q1: Hereafter code produce two remote sections in the git config file.

Console.WriteLine(GlobalSettings.Version); //{0.22.0-8daef23-785d8c4 (x86 - Threads, Https)}

using (var repo = new Repository(Repository.Init(".\\test.git", true)))
{
    repo.Network.Remotes.Add("origin", @"https://github.com/libgit2/libgit2sharp.git");
}
var config = File.ReadAllText(@".\\test.git\\config");
Console.Write(config);
/*
[remote "origin"]
    url = https://github.com/libgit2/libgit2sharp.git
[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
*/

Q2: How to set a remote as mirror. I think there are no API consider about this.

[remote "origin"]
    url = https://github.com/libgit2/libgit2sharp.git
    fetch = +refs/*:refs/*
    mirror = true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions