cake-contrib / Cake_Git

Cake AddIn that extends Cake with Git features using LibGit2 and LibGit2Sharp

Home Page:https://cakebuild.net/extensions/cake-git

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Examples

FynZ opened this issue · comments

Hi,

Would be great to have examples with the package documentation. Can't have the GitPushRefs call to work and I have to fallback to a Cmd call to achieve what I want.

Thanks :).

Alias is documented at
https://cakebuild.net/api/Cake.Git/GitAliases/D653967D
and
https://cakebuild.net/api/Cake.Git/GitAliases/FB8D8875

Looks like something might be missing from nuget package as examples are in code but not on cakebuild.net

/// <example>
/// <code>
/// GitPushRef("c:/temp/cake", "remote", "refSpec");
/// </code>
/// </example>

/// <example>
/// <code>
/// GitPushRef("c:/temp/cake", "username", "password", "remote", "refSpec");
/// </code>
/// </example>

Looking at pr #11 which added this there's an example

GitTag("./", "v1.0.0");
GitPushRef("./", gitUsername, gitPassword, "origin", "v1.0.0");

Hi, tank for the help and sorry for the delay.

It was indeed a configuration problem as I was passing "master" as the fourth argument instead of "origin" (bad checking on my part) but now stuck with another issue which is LibGit2Sharp.LibGit2SharpException: unsupported URL protocol. The password I am using contains html characters but the same error occurs if I pass the raw password or the encoded one.

Thanks.

Here is a simple code of what i'm doing in my cake script

string usr = "my_super_user";
string pwd = "my_super_password";

DirectoryPath repositoryPath = MakeAbsolute(Directory("../"));            
string tag = $"TEST-TAG";

Information("Tagging current commit with value {0}", tag);
GitTag(repositoryPath, tag, commit);

Information("Push tag {0} to remote repository", tag);
GitPushRef(repositoryPath, usr, pwd, "origin" , tag);