Glide命令,如何使用glide,glide.lock
Desc:10分钟了解glide相关命令,做好包管理准备 以下是Glide命令,其中大部分命令是帮助您管理工作区。 glide create (别名 init)初始化新工作区。除此之外,这会创建一个 $ glide create [INFO] Generating a YAML configuration file and guessing the dependencies [INFO] Attempting to import from other package managers (use --skip-import to skip) [INFO] Scanning code to look for dependencies [INFO] --> Found reference to github.com/Masterminds/semver [INFO] --> Found reference to github.com/Masterminds/vcs [INFO] --> Found reference to github.com/codegangsta/cli [INFO] --> Found reference to gopkg.in/yaml.v2 [INFO] Writing configuration file (glide.yaml) [INFO] Would you like Glide to help you find ways to improve your glide.yaml configuration? [INFO] If you want to revisit this step you can use the config-wizard command at any time. [INFO] Yes (Y) or No (N)? n [INFO] You can now edit the glide.yaml file. Consider: [INFO] --> Using versions and ranges. See https://glide.sh/docs/versions/ [INFO] --> Adding additional metadata. See https://glide.sh/docs/glide.yaml/ [INFO] --> Running the config-wizard command to improve the versions in your configuration 这里提到的配置向导可以在这里运行或者以后手动运行。此向导可帮助您找出可用于依赖项的版本和范围。 glide config-wizard这将运行一个向导,扫描依赖关系并检索其上的信息,以提供可以交互选择的建议。例如,它可以发现依赖关系是否使用语义版本,并帮助您选择要使用的版本范围。 glide get [package name]你可以通过 $ glide get github.com/Masterminds/cookoo 当使用
$ glide get github.com/Masterminds/cookoo#^1.2.3 版本通过锚( glide update (别名 up)下载或更新 $ glide up 这将递归在寻找由Glide,Godep,gb,gom和GPM管理的其他项目的包。当找到这些包时,将根据需要安装这些包。 将创建或更新 要从已提取的包中删除任何嵌套的 glide install当你想从 $ glide install 这将读取 当 如果没有 要从已提取的包中删除任何嵌套的 glide novendor (别名 nv)当你运行 $ go test $(glide novendor) 这将对您的项目的所有目录( glide name当你使用 Glide 编写脚本时,有时你需要知道你正在使用的包的名称。 glide listGlide 的 $ glide list INSTALLED packages: vendor/github.com/Masterminds/cookoo vendor/github.com/Masterminds/cookoo/fmt vendor/github.com/Masterminds/cookoo/io vendor/github.com/Masterminds/cookoo/web vendor/github.com/Masterminds/semver vendor/github.com/Masterminds/vcs vendor/github.com/codegangsta/cli vendor/gopkg.in/yaml.v2 glide help打印 glide 帮助 $ glide help glide --version显示版本信息 $ glide --version glide version 0.12.0 glide mirror镜像提供了将 repo 位置替换为作为原始镜像的另一位置的能力。当您希望拥有连续集成(CI)系统的缓存时,或者如果您要在本地位置的依赖项上工作时,这是非常有用的。 镜像存储在 到管理器镜像的三个命令 在表单中使用 glide mirror set [original] [replacement] 或 glide mirror set [original] [replacement] --vcs [type] 例如: $ glide mirror set https://github.com/example/foo https://git.example.com/example/foo.git $ glide mirror set https://github.com/example/foo file:///path/to/local/repo --vcs git 请在表单中使用 glide mirror remove [original] 例如: $ glide mirror remove https://github.com/example/foo 本文链接:https://deepzz.com/post/glide-package-management-command.html (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |