GitCommands.GitModule.CommitCmd C# (CSharp) Method

CommitCmd() public method

public CommitCmd ( bool amend, bool signOff = false, string author = "", bool useExplicitCommitMessage = true, bool noVerify = false ) : string
amend bool
signOff bool
author string
useExplicitCommitMessage bool
noVerify bool
return string
        public string CommitCmd(bool amend, bool signOff = false, string author = "", bool useExplicitCommitMessage = true, bool noVerify = false)
        {
            string command = "commit";
            if (amend)
                command += " --amend";

            if (noVerify)
                command += " --no-verify";

            if (signOff)
                command += " --signoff";

            if (!string.IsNullOrEmpty(author))
                command += " --author=\"" + author + "\"";

            if (useExplicitCommitMessage)
            {
                var path = Path.Combine(GetGitDirectory(), "COMMITMESSAGE");
                command += " -F \"" + path + "\"";
            }

            return command;
        }
GitModule