Skip to content

repo.Network.Remotes.Remove does not remove the remote #1437

Open
@suwatch

Description

@suwatch

We have this code below where we remove remote (origin) before adding a new one. From time to time, Add would fail with remote already exists. Is there an issue where remote is not removed when calling repo.Network.Remotes.Remove? Is it a race condition? We doubt it is since rerun the same code still yield remote already exists. Anything we do wrong or can improve? BTW, if we run git remote remove origin command, then it is removed - so repo is not corrupted.

repo.Network.Remotes.Remove(_remoteAlias);

// Configure the remote
remote = repo.Network.Remotes.Add(_remoteAlias, remoteUrl, refSpec);

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