is there a git add remote extension #3416
-
I need to add a remote repository in my cake build.
I looked at this package Cake.Git But I don't see that command in there. Is there a package that does that or allows me to issue custom commands in git? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I can just do a command line process, it looks like |
Beta Was this translation helpful? Give feedback.
-
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; });
} |
Beta Was this translation helpful? Give feedback.
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: