6 years, 2 months ago.

How do I manage the code in my local repository?

Greetings!

First of all, my apologies for a question that is not only totally noob to Mbed, but noob to version control - as I have been using both for about a week.

My target system is the micro:bit, and I have been doing some sample coding with a copy of the "simple animation" code so that I can understand how to work with the display. I am doing this because the documentation on how to handle the display bitmaps is, (ahem!), less than crystal clear.

Viz.: https://lancaster-university.github.io/microbit-docs/ubit/display/#using-the-display which references the MicroBitImage data type here at https://lancaster-university.github.io/microbit-docs/data-types/image/

If you want, I can discuss my questions/issues with the documentation itself in a different thread.

As a result, I took the "simple animation" code and played around with it, saving it and dropping it on the micro:bit to see what would happen. I created several different compiled .hex files and ran them to see what the effects of manipulating the bit-strings would be.

Having satisfied myself that I understood it - at least in part - I decided to play around with revisions and "committing" changes, since revisions to my working code did not happen automatically each time I saved. I suspect that the reason for this is that in a "real" development environment, programmers want to "fuss around" with code without having four-zillion revisions in their local repository - that might well end up in the master repository.

In any event, I tried a "test" commit. And - after being prompted to commit half the known universe - including damn-near every library in existence, I finally was able to get a "committed" revision.

My setup: Win7 Pro 64 bit, updated as of this current date. Firefox 64 bit, also current. A micro:bit that is my test bed, and the target of my compilations.

I have "imported" a number of programs (projects?), from the sites that allow folks like me to import simple programs to experiment with.

I am not - insofar as I know - using any remote repositories for version control.

Questions:

  • Having messed around with a particular "project"/"program", can I delete it and all it's revisions?
  • Can I "un-commit" a revision in my local repository?
  • Where is the local repository located? (in case I want to back it up, for example.)
  • Assuming the libraries are current, as downloaded, is it possible to commit a change without committing every library on my machine? Or is that only necessary for the first commit?

Thanks again for your patience with my ignorance.

Jim "JR"

1 Answer

6 years, 2 months ago.

Hi Jim,

In regards to the MicroBit documentation, I would definitely raise a GitHub "Issue" on their GitHub repository here: https://github.com/lancaster-university/microbit-dal/ . You can create an issue and detail all of your concerns on their repository with the following link (if you have a GitHub user account): https://github.com/lancaster-university/microbit-dal/issues/new

For the online compiler program management and revision system, I would first like to point out this tutorial to you: https://os.mbed.com/docs/latest/tutorials/publishing-code.html

Now to answer your questions:

  1. You can delete your project/program from the online compiler by right-clicking on the project name and selecting "Delete..." - this will however only delete the "local" repository from your online compiler. If you "published" this program to your user profile, you will still be able to see it on your user page, for example: https://os.mbed.com/users/jplunkett/code/jenny-test/
  2. I would read through the following documentation to learn how you can "switch" between commits/revisions in your repository here: https://os.mbed.com/handbook/Compiler-Version-Control
  3. The local repository in your online compiler (assuming you have not published it to your user page as in the first bullet) is located in the server space we have for our os.mbed.com users. If you would like to backup your repository to your computer you can use our offline Mbed CLI, here are some instructions on how to get started with the offline Mbed CLI: https://os.mbed.com/docs/latest/tutorials/quick-start-offline.html
  4. Your first commit for your program will include all files that have been changed/added since the repository was created. If you did not make any changes to your program's libraries then the next commit you have will not include change information regarding those libraries. Commiting your code creates a snapshot of your code at a point in time, that you can put a message against. It allows you to compare versions for differences and go back to them in the future (source).

I'm happy to answer any of your questions, so please let me know if you need anything!

- Jenny, team Mbed

If this solved your question, please make sure to click the "Thanks" link below!

Accepted Answer