Skip to content

Commit c81ebd4

Browse files
committed
Documentation improvements:
* Added section about working context and command help * Explanation about the difference between `mbed update` and `mbed update branch`
1 parent 98c3035 commit c81ebd4

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,17 @@ To uninstall *mbed-cli* you can use:
6262

6363
## Using mbed-cli
6464

65+
### Working context and command help
66+
67+
All *mbed CLI* commands use the current directory as a working context, meaning that before calling any *mbed* command, you should first change your working directory to the one you want to operate in. For example:
68+
```
69+
$ cd my-program
70+
$ cd mbed-os
71+
$ mbed update master # updates "mbed-os", not "my-program"
72+
```
73+
74+
*mbed CLI* provides list of all available commnads and global help via `mbed --help`, and also command-specific help via `--help` param to the command, e.g. `mbed update --help`.
75+
6576
### Creating and importing programs
6677

6778
mbed CLI allows creating new programs and importing existing ones, always with the full mbed-os release as the program's basis.
@@ -187,6 +198,8 @@ You can apply the same mechanism for libraries and their dependencies by executi
187198

188199
#### Update options
189200

201+
<span style="background-color:#E6E6E6;border:1px solid #000;display:block; height:100%; padding:10px">**Note**: As with any *mbed CLI* command, `mbed update` uses the current directory as a working context, meaning that before calling `mbed update` you should first change your working directory to the one you want to update, e.g. `cd mbed-os`.</span>
202+
190203
To help understand what options you can use with *mbed-cli*, please see the examples below.
191204

192205
**Case 1: I want to update a program or a library to the latest version in a specific or current branch**
@@ -199,6 +212,8 @@ __I want a clean update (and discard uncommitted changes)__
199212

200213
Run `mbed update [branch] --clean`
201214

215+
It's important to remember that specifying a branch to `mbed update` would only checkout that branch and won't automatically merge/fast-forward to the remote/upstream branch. You can run `mbed update` to merge (fast-forward) your local branch with the latest remote branch. On git you can do `git pull`.
216+
202217
**Case 2: I want to update a program or a library to a specific revision or a tag**
203218

204219
__I want to preserve my uncommitted changes__

0 commit comments

Comments
 (0)