This repository was archived by the owner on Sep 9, 2020. It is now read-only.
File tree 1 file changed +25
-2
lines changed 1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -30,20 +30,42 @@ guarantee these changes will be backwards-compatible.
30
30
31
31
## Usage
32
32
33
+ ### Initial setup
34
+
33
35
Get the tool via
34
36
35
37
``` sh
36
38
$ go get -u github.com/golang/dep/cmd/dep
37
39
```
38
40
39
- Typical usage - either on a new project or converting an existing one - is
41
+ To set up Dep on a project, run the following from your project root directory:
40
42
41
43
``` sh
42
44
$ dep init
43
45
$ dep ensure -update
44
46
```
45
47
46
- If your project was already using a ` vendor/ ` directory, it was backed up to ` _vendor-TIMESTAMP/ ` .
48
+ ` dep init ` will do the following:
49
+
50
+ 1 . Look for [ existing dependency management
51
+ files] ( docs/FAQ.md#what-external-tools-are-supported ) to convert
52
+ 1 . Back up your existing ` vendor/ ` directory to
53
+ ` _vendor-TIMESTAMP/ `
54
+ 1 . Generate [ ` Gopkg.toml ` ] ( Gopkg.toml.md ) and ` Gopkg.lock ` files
55
+
56
+ ### Day-to-day workflow
57
+
58
+ When you or a collaborator add/remove/change dependencies, run
59
+
60
+ ``` sh
61
+ $ dep ensure
62
+ ```
63
+
64
+ This will synchronize your dependencies in ` vendor/ ` to make sure they match
65
+ what's in your ` import ` s and ` Gopkg.toml ` . ` dep ensure ` is safe to run early and
66
+ often.
67
+
68
+ #### Updating a specific dependency
47
69
48
70
To update a dependency to a new version, you might run
49
71
@@ -55,6 +77,7 @@ See the help text for more detailed usage instructions.
55
77
56
78
``` sh
57
79
$ dep help ensure
80
+ $ dep ensure -examples
58
81
```
59
82
60
83
## Feedback
You can’t perform that action at this time.
0 commit comments