diff --git a/git.go b/git.go index 8243b09..ed0c6f2 100644 --- a/git.go +++ b/git.go @@ -175,3 +175,18 @@ func (g *git) ConfigAuthor(name string, email string) *define.Result { } return nil } + +// Clone 拉取 git 仓库代码 +// +// Author : go_developer@163.com<白茶清欢> +// +// Date : 14:03 2022/6/27 +func (g *git) Clone(repo string, saveDir string) *define.Result { + param := []string{ + repo, + } + if len(saveDir) > 0 { + param = append(param, saveDir) + } + return Execute(g.workDir, g.gitCmdPath, param) +}