Skip to content

Commit ad1fb24

Browse files
committed
Updated documentation with references to 'mbed releases'
1 parent 93fd158 commit ad1fb24

File tree

1 file changed

+62
-10
lines changed

1 file changed

+62
-10
lines changed

README.md

Lines changed: 62 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,24 @@ Use `mbed ls` to list all the libraries imported to your program:
163163

164164
```
165165
$ cd mbed-os-program
166-
$ mbed ls -a
167-
mbed-os-program (mbed-os-program)
168-
`- mbed-os (https://github.com/ARMmbed/mbed-os#89962277c207)
166+
$ mbed ls
167+
mbed-os-program (no revision)
168+
`- mbed-os (#182bbd51bc8d, tags:latest, mbed-os-5.6.5)
169+
```
170+
171+
Use `mbed releases` to list all releases in a program or library:
172+
173+
```
174+
$ cd mbed-os
175+
$ mbed releases
176+
mbed-os (#182bbd51bc8d, tags:latest, mbed-os-5.6.5)
177+
...
178+
* mbed-os-5.6.0
179+
* mbed-os-5.6.1
180+
* mbed-os-5.6.2
181+
* mbed-os-5.6.3
182+
* mbed-os-5.6.4
183+
* mbed-os-5.6.5 <- current
169184
```
170185

171186
<span class="notes">**Note**: If you want to start from an existing folder in your workspace, you can use `mbed new .`, which initializes an Mbed program, as well as a new Git or Mercurial repository in that folder. </span>
@@ -686,11 +701,11 @@ To push the changes in your local tree upstream, run `mbed publish`. `mbed publi
686701
Let's assume that the list of dependencies of your program (obtained by running `mbed ls`) looks like this:
687702

688703
```
689-
my-mbed-os-example (a5ac4bf2e468)
690-
|- mbed-os (5fea6e69ec1a)
691-
`- my-libs (e39199afa2da)
692-
|- my-libs/iot-client (571cfef17dd0)
693-
`- my-libs/test-framework (cd18b5a50df4)
704+
my-mbed-os-example (#a5ac4bf2e468)
705+
|- mbed-os (#182bbd51bc8d, tags:latest, mbed-os-5.6.5)
706+
`- my-libs (#e39199afa2da)
707+
|- my-libs/iot-client (#571cfef17dd0)
708+
`- my-libs/test-framework (#cd18b5a50df4)
694709
```
695710

696711
Let's assume that you make changes to `iot-client`. `mbed publish` detects the change on the leaf `iot-client` dependency and asks you to commit it. Then `mbed publish` detects that `my-libs` depends on `iot-client`, updates the `my-libs` dependency on `iot-client` to its latest version by updating the `iot-client.lib` file and asks you to commit it. This propagates up to `my-libs` and finally to your program, `my-mbed-os-example`.
@@ -741,6 +756,42 @@ The update command fails if there are changes in your program or library that `m
741756

742757
### Updating to an upstream version
743758

759+
Before updating a program or a library, it's good to know the names of the stable releases, usually marked with a tag using a common format, e.g. 1.2, v1.0.1, r5.6, mbed-os-5.6, etc.
760+
761+
You can find stable release versions of a program or a library using the `mbed releases` command:
762+
763+
```
764+
$ cd mbed-os
765+
$ mbed releases
766+
mbed-os (#182bbd51bc8d, tags:latest, mbed-os-5.6.5)
767+
...
768+
* mbed-os-5.6.0
769+
* mbed-os-5.6.1
770+
* mbed-os-5.6.2
771+
* mbed-os-5.6.3
772+
* mbed-os-5.6.4
773+
* mbed-os-5.6.5 <- current
774+
```
775+
776+
You can also recursively list stable releases for your program and libraries using the `-r` switch, e.g. `mbed releases -r`. The output of this command is usually long, thus it's not included in this documentation.
777+
778+
Lastly, you can list unstable releases, like release candidates, alphas, betas, using the `-u` switch.
779+
```
780+
$ cd mbed-client
781+
$ mbed releases -u
782+
mbed-client (#31e5ce203cc0, tags:v3.0.0)
783+
* mbed-os-5.0-rc1
784+
* mbed-os-5.0-rc2
785+
* r0.5-rc4
786+
...
787+
* v2.2.0
788+
* v2.2.1
789+
* v3.0.0 <- current
790+
```
791+
792+
You can use the `-a` switch to print out release and revision hash pairs.
793+
794+
744795
#### Updating a program
745796

746797
To update your program to another upstream version, go to the root folder of the program, and run:
@@ -751,6 +802,7 @@ $ mbed update [branch|tag|revision]
751802

752803
This fetches new revisions from the remote repository, updating the program to the specified branch, tag or revision. If you don't specify any of these, then `mbed update` updates to the latest revision of the current branch. `mbed update` performs this series of actions recursively against all dependencies in the program tree.
753804

805+
754806
#### Updating a library
755807

756808
You can change the working directory to a library folder and use `mbed update` to update that library and its dependencies to a different revision than the one referenced in the parent program or library. This allows you to experiment with different versions of libraries/dependencies in the program tree without having to change the parent program or library.
@@ -769,11 +821,11 @@ There are two main scenarios when updating:
769821

770822
* Update with local uncommitted changes: *dirty* update.
771823

772-
Run `mbed update [branch|revision|tag_name]`. You might have to commit or stash your changes if the source control tool (Git or Mercurial) throws an error that the update will overwrite local changes.
824+
Run `mbed update [branch|tag|revision]`. You might have to commit or stash your changes if the source control tool (Git or Mercurial) throws an error that the update will overwrite local changes.
773825

774826
* Discard local uncommitted changes: *clean* update.
775827

776-
Run `mbed update [branch|revision|tag_name] --clean`
828+
Run `mbed update [branch|tag|revision] --clean`
777829

778830
Specifying a branch to `mbed update` will only check out that branch and won't automatically merge or 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`.
779831

0 commit comments

Comments
 (0)