From c42fac5134e5fa827657d6c92c5ec8f3c8298fe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Mon, 27 Jun 2022 14:11:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8B=89=E5=8F=96git?= =?UTF-8?q?=E4=BB=93=E5=BA=93=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- git.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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) +}