# Setup your project. cd"my project in GOPATH" govendor init
# Add existing GOPATH files to vendor. govendor add +external
# View your work. govendor list
# Look at what is using a package govendor list -v fmt
# Specify a specific version or revision to fetch govendor fetch golang.org/x/net/context@a4bbce9fcae005b22ae5443f6af064d80a6f5a55 govendor fetch golang.org/x/net/context@v1 # Get latest v1.*.* tag or branch. govendor fetch golang.org/x/net/context@=v1 # Get the tag or branch named "v1".
# Update a package to latest, given any prior version constraint govendor fetch golang.org/x/net/context
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
init Create the "vendor" folder and the "vendor.json" file. list List and filter existing dependencies and packages. add Add packages from $GOPATH. update Update packages from $GOPATH. remove Remove packages from the vendor folder. status Lists any packages missing, out-of-date, or modified locally. fetch Add new or update vendor folder packages from remote repository. sync Pull packages into vendor folder from remote repository with revisions from vendor.json file. migrate Move packages from a legacy tool to the vendor folder with metadata. get Like "go get" but copies dependencies into a "vendor" folder. license List discovered licenses for the given status or import paths. shell Run a "shell" to make multiple sub-commands more efficent for large projects.
go tool commands that are wrapped: `+<status>` package selection may be used with them fmt, build, install, clean, test, vet, generate
1 2 3 4 5 6 7 8 9 10 11 12
+local (l) packages in your project +external (e) referenced packages in GOPATH but not in current project +vendor (v) packages in the vendor folder +std (s) packages in the standard library
+unused (u) packages in the vendor folder, but unused +missing (m) referenced packages but not found
create, init Initialize a new project, creating a glide.yaml file get Install one or more packages into `vendor/` and add dependency to glide.yaml. remove, rm Remove a package from the glide.yaml file, and regenerate the lock file. import Import files from other dependency management systems. name Print the name of this project. novendor, nv List all non-vendor paths in a directory. rebuild Rebuild ('go build') the dependencies install, i Install a project's dependencies update, up Update a project's dependencies tree Tree prints the dependencies of this project as a tree. list List prints all dependencies that the present code references. info Info prints information about this project about Learn about Glide
GLOBAL OPTIONS: --yaml, -y "glide.yaml" Set a YAML configuration file. --quiet, -q Quiet (no info or debug messages) --debug Print Debug messages (verbose) --home "/home/dev/.glide" The location of Glide files [$GLIDE_HOME] --no-color Turn off colored output forlog messages --help, -h show help --version, -v print the version
When you want to install the specific versions from the glide.lock file use glide install.
$ glide install
This will read the glide.lock file and install the commit id specific versions there.
When the glide.lock file doesn’t tie to the glide.yaml file, such as there being a change, it will provide a warning. Running glide up will recreate the glide.lock file when updating the dependency tree.
If no glide.lock file is present glide install will perform an update and generate a lock file.