Skip to content

is there a git add remote extension #3416

Discussion options

You must be logged in to vote

Cake.Git is a wrapper around LibGit2Sharp, so in the case of remotes, it's a feature that LibGit2Sharp supports but it's not yet exposed as a Cake alias in the Cake.Git addin. Thus you can call into LibGit2Sharp directly yourself:

#addin "nuget:?package=Cake.Git&version=1.0.1"

using LibGit2Sharp;

using (var repository = new Repository(@"C:\augusto\my-git-repo"))
{
    var remoteUrl = "https://github.com/owner/my-git-repo.git";
    repository.Network.Remotes.Update("origin", r => { r.Url = remoteUrl; });
}

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by pascalberger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants