Skip to content

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):

  1. install git if not done so already https://git-scm.com/downloads
  2. create a git repository, private and empty, on [github] (https://docs.github.com/en/get-started/quickstart/create-a-repo){target="blank”}
  3. [clone the newly created repository on your computer] (https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository){target="blank”}
  4. add a .ignore file 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
  5. add the content of the blinky project you have been working to the git repository by copying folders/files into the place you cloned the git repository
  6. add a README.md according to what is requested (organization)
  7. include the content to the git repo with the command git add *. The git status command will indicate whether you have forgotten anything. Once done, confirm the content by typing git commit -m "Initial version of blinky"
  8. tag the version (git tag "1.0")
  9. push the version to github (git push -u main origin)
  10. create a git branch with the command git branch misra_fixes
  11. switch to the newly created branch with git switch misra_fixes
  12. fix all MISRA issues present in your main.c file
  13. commit the changes (see previous git commit point)
  14. push the changes to github
  15. control that your work is indeed on github through the corresponding web interface