You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-3Lines changed: 21 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,8 @@ This document covers the installation and usage of *mbed CLI*.
6
6
7
7
## Table of Contents
8
8
1.[Requirements](#requirements)
9
-
1.[Installing mbed-cli](#installing-mbed-cli)
9
+
1.[Installing and uninstalling](#installing-mbed-cli)
10
+
1.[Working context and command help](#working-context-and-command-help)
10
11
1.[Creating and importing programs](#creating-and-importing-programs)
11
12
1. [Importing an existing program](#importing-and-creating-programs)
12
13
2. [Creating a new program](#creating-a-new-program)
@@ -62,6 +63,19 @@ To uninstall *mbed-cli* you can use:
62
63
63
64
## Using mbed-cli
64
65
66
+
### Working context and command help
67
+
68
+
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:
69
+
```
70
+
$ cd my-program
71
+
$ cd mbed-os
72
+
$ mbed update master # updates "mbed-os", not "my-program"
73
+
```
74
+
75
+
Also note that *mbed CLI* requires that a program, the root of the code tree, is under version control - either Git or Mercurial. This makes it possible to seamlessly switch between revisions of the whole program and its libraries, control the program history, synchronize the program with remote repositories, share it with others, etc. Version control is also the primary and preferred delivery mechanism for mbed OS source code, which allows everyone to contribute to mbed OS at any time!
76
+
77
+
*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`.
78
+
65
79
### Creating and importing programs
66
80
67
81
mbed CLI allows creating new programs and importing existing ones, always with the full mbed-os release as the program's basis.
<spanclass="notes">**Note**:Asome of the repositories that *mbed-cli* will clone might require special access (Mercurial will ask you for your credentials if that's the case). If you don't have access, e-mail [[email protected]](mailto:[email protected]) or [[email protected]](mailto:[email protected]) with your developer.mbed.org account name.</span>
127
+
<spanclass="notes">**Note**: Some of the repositories that *mbed-cli* will clone might require special access (Mercurial will ask you for your credentials if that's the case). If you don't have access, e-mail [[email protected]](mailto:[email protected]) or [[email protected]](mailto:[email protected]) with your developer.mbed.org account name.</span>
114
128
115
129
### Adding and removing libraries
116
130
@@ -187,6 +201,8 @@ You can apply the same mechanism for libraries and their dependencies by executi
187
201
188
202
#### Update options
189
203
204
+
<spanstyle="background-color:#E6E6E6;border:1pxsolid#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>
205
+
190
206
To help understand what options you can use with *mbed-cli*, please see the examples below.
191
207
192
208
**Case 1: I want to update a program or a library to the latest version in a specific or current branch**
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`.
219
+
202
220
**Case 2: I want to update a program or a library to a specific revision or a tag**
203
221
204
222
__I want to preserve my uncommitted changes__
@@ -211,7 +229,7 @@ Run `mbed update <#rev|tag_name> --clean`
211
229
212
230
The `--clean` option tells *mbed-cli* to update that program or library and its dependencies, and discard all local changes.
213
231
214
-
__When you have unpublished local libraries
232
+
__When you have unpublished local libraries__
215
233
216
234
There are two additional options that define how unpublished local libraries are handled:
0 commit comments