go env -w GOPROXY=https://goproxy.cn,direct
# go env -w GOPROXY=https://mirrors.aliyun.com/goproxy,direct
go get -u github.com/urfave/cli/v2
go get -u gopkg.in/yaml.v3
mod
go mod tidy
go mod download
run
go run main.go
run help
Windows 环境为 %xxx%
Linux 环境为 $xxx
go run main.go --help
$ go run main.go --help
NAME:
git-go - 基于 Go 语言开发的 Git 命令行工具
USAGE:
git-go [global options] command [command options] [arguments...]
VERSION:
dev
AUTHOR:
徐晓伟 <xuxiaowei@xuxiaowei.com.cn>
COMMANDS:
commit-author, commitAuthor, ca Name <email> 格式的提交作者
commit-branch, commitBranch, cb 提交分支名称
commit-sha, commitSha, cs 项目为其构建的提交修订
commit-short-sha, commitShortSha, css 项目为其构建的提交修订的前八个字符
commit-tag, commitTag, ct 提交标签名称
commit-timestamp, commitTimestamp, cts ISO 8601 格式的提交时间戳,如:2023-10-02T00:29:17+08:00
now ISO 8601 格式的当前时间戳,如:2023-10-02T02:35:20+08:00
go-version, goVersion, gv go version 命令返回值,如:go version go1.21.1 windows/amd64
go-short-version, goShortVersion, gsv go version 命令返回值截取版本号,如:go1.21.1
go-platform, goPlatform, gp go version 命令返回值截取平台信息,如:windows/amd64
git-tree-state, gitTreeState, gts git 树状态:clean、dirty
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--help, -h show help
--version, -v print the version
COPYRIGHT:
徐晓伟工作室 <xuxiaowei@xuxiaowei.com.cn>
git-go
Git Go 脚手架
开发命令
get
mod
run
run help
test
build
Windows
Linux
Darwin