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
<spanclass="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
686
701
Let's assume that the list of dependencies of your program (obtained by running `mbed ls`) looks like this:
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
741
756
742
757
### Updating to an upstream version
743
758
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:
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
+
744
795
#### Updating a program
745
796
746
797
To update your program to another upstream version, go to the root folder of the program, and run:
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.
753
804
805
+
754
806
#### Updating a library
755
807
756
808
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:
769
821
770
822
* Update with local uncommitted changes: *dirty* update.
771
823
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.
773
825
774
826
* Discard local uncommitted changes: *clean* update.
775
827
776
-
Run `mbed update [branch|revision|tag_name] --clean`
828
+
Run `mbed update [branch|tag|revision] --clean`
777
829
778
830
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`.
0 commit comments