Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Commit cb849a7

Browse files
committed
Explain first-run vs. day-to-day workflow
- Explain that `dep init` will try and import from other package managers - Explain the day-to-day workflow of using Dep.
1 parent c0f3d80 commit cb849a7

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

README.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,42 @@ guarantee these changes will be backwards-compatible.
3030

3131
## Usage
3232

33+
### Initial setup
34+
3335
Get the tool via
3436

3537
```sh
3638
$ go get -u github.com/golang/dep/cmd/dep
3739
```
3840

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:
4042

4143
```sh
4244
$ dep init
4345
$ dep ensure -update
4446
```
4547

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
4769

4870
To update a dependency to a new version, you might run
4971

@@ -55,6 +77,7 @@ See the help text for more detailed usage instructions.
5577

5678
```sh
5779
$ dep help ensure
80+
$ dep ensure -examples
5881
```
5982

6083
## Feedback

0 commit comments

Comments
 (0)