gitcakebuild

Use cake to perform git commit without name and email


The cake GitCommit alias wants a name and email:

public static GitCommit GitCommit(this ICakeContext context, DirectoryPath repositoryDirectoryPath, string name, string email, string message)

How can I commit without specifying them (and it would use the repo's defaults)?

For example, the same as I can do in the shell: $ git commit -m message.


Solution

  • I found a reasonable workaround:

    var name  = GitConfigGet<string>(repoDirectory, "user.name"));
    var email = GitConfigGet<string>(repoDirectory, "user.email");
    
    GitCommit(repoDirectory, name, email, "message");