Documentation ¶
Index ¶
Constants ¶
View Source
const ( CFG = ".clsmt" NAME = "clsmt" )
Variables ¶
View Source
var ( ErrLatestVersion = errors.New("version is already up to date") ErrVersionLoad = errors.New("version number load failed") ErrTagExist = errors.New("tag exist already") ErrUpgradeAsset = errors.New("invalid upgrade asset file") ErrDownloadAsset = errors.New("download asset failed") ErrCreateTmpfile = errors.New("cannot create temporary file") ErrUnpack = errors.New("unpack upgrade asset file failed") ErrCopyFile = errors.New("copy file failed") ErrNotFound = errors.New("404") )
View Source
var ( UpgradeUrls = []UpgradeUrl{ {"gitea", "http://local.lovelacelee.com:9011/api/v1/repos/connard/mirror-tools/releases"}, {"github", "https://api.github.com/repos/lovelacelee/mirror-tools/releases"}, } ClsmtConfig = "http://congli.imwork.net/dl/config/clsmt.yaml" )
View Source
var (
ClsmtInfo string = `` /* 180-byte string literal not displayed */
)
View Source
var GitUsageMap = map[string][]gitCommand{ "Tag管理": { {"git tag <tagname>", "增加标签", []string{ "git tag v0.0.1", }}, {"git tag -d <tagname>", "删除标签", []string{ "git tag -d v0.0.1", }}, }, "分支管理": { {"git checkout <branch/tag>", "切换到指定分支或标签", []string{ "git checkout origin 检出到origin分支", "git checkout master 检出到master分支", "git checkout v0.0.1 检出到tag名为v0.0.1", }}, {"git branch -d <branch>", "删除本地分支", []string{ "git branch -d origin", }}, }, "本地Repo管理": { {"git reset --hard HEAD", "撒消工作目录中所有未提交文件的修改内容", []string{ "git reset --hard HEAD", "git reset --hard HEAD^", "git reset --hard HEAD~1", }}, {"git checkout HEAD <file>", "撤消指定的未提交文件的修改内容", []string{ "git checkout HEAD .gitignore", }}, {"git rm --cached <file>", "停止跟踪文件但不删除", []string{ "git rm --cached .gitkeep", }}, {"git revert <commit>", "撤消指定的提交", []string{ "git revert 2348s7dadfad", }}, }, "子模块管理": { {"git submodule update --init --recursive", "初次更新带有submodule的git仓库", []string{ "git submodule update --init --recursive", }}, }, "日志管理": { {"git log -p <file>", "查看指定文件的提交历史", []string{ "git log -p .gitignore", }}, {"git blame <file>", "以列表方式查看指定文件的提交历史", []string{ "git blame .gitkeep", }}, }, }
Functions ¶
func ErrWrapString ¶
Types ¶
type UpgradeUrl ¶
Click to show internal directories.
Click to hide internal directories.