diff --git a/git.go b/git.go index 5b23c4d..bd657d8 100644 --- a/git.go +++ b/git.go @@ -148,3 +148,25 @@ release FinishTime: 0, } } + +// ConfigAuthor 配置开发人员信息 +// +// Author : go_developer@163.com<白茶清欢> +// +// Date : 20:40 2022/6/14 +func (g *git) ConfigAuthor(name string, email string) *define.Result { + // git config user.name 白茶清欢 + if len(name) > 0 { + param := []string{"config", "user.name", name} + if r := Execute(g.workDir, g.gitCmdPath, param); nil != r.Error { + return r + } + } + if len(email) > 0 { + param := []string{"config", "user.email", email} + if r := Execute(g.workDir, g.gitCmdPath, param); nil != r.Error { + return r + } + } + return nil +}