Beginning with `git`
Getting started
For people who have never used git before, here some tips to use it (related
to Robust Development Methodology codelab
and subsequent ones):
- install
gitif not done so already https://git-scm.com/downloads - create a
gitrepository, private and empty, on [github] (https://docs.github.com/en/get-started/quickstart/create-a-repo){target="blank”} - [clone the newly created repository on your computer] (https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository){target="blank”}
- add a
.ignorefile at the root of your project with the following content (taken from https://github.com/mrshrdlu/gitignore-keil/blob/master/keil.gitignore) - rename the downloaded file to.gitignore. This will ensure that ARM Keil generated files will not be “tracked” bygit - add the content of the blinky project you have been working to the
gitrepository by copying folders/files into the place you cloned thegitrepository - add a README.md according to what is requested (organization)
- include the content to the
gitrepo with the commandgit add *. Thegit statuscommand will indicate whether you have forgotten anything. Once done, confirm the content by typinggit commit -m "Initial version of blinky" - tag the version (
git tag "1.0") - push the version to github (
git push -u main origin) - create a
gitbranch with the commandgit branch misra_fixes - switch to the newly created branch with
git switch misra_fixes - fix all MISRA issues present in your
main.cfile - commit the changes (see previous
git commitpoint) - push the changes to github
- control that your work is indeed on github through the corresponding web interface
Useful links
gitand github for beginners: https://www.freecodecamp.org/news/git-and-github-for-beginners/- using
gitbranches: https://www.atlassian.com/git/tutorials/using-branches gittag: https://www.atlassian.com/git/tutorials/inspecting-a-repository/git-taggit“Bible”: https://git-scm.com/book/en/v2