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
git
if not done so already https://git-scm.com/downloads - create a
git
repository, 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
.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
- add the content of the blinky project you have been working to the
git
repository by copying folders/files into the place you cloned thegit
repository - add a README.md according to what is requested (organization)
- include the content to the
git
repo with the commandgit add *
. Thegit status
command 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
git
branch 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.c
file - commit the changes (see previous
git commit
point) - push the changes to github
- control that your work is indeed on github through the corresponding web interface
Useful links
git
and github for beginners: https://www.freecodecamp.org/news/git-and-github-for-beginners/- using
git
branches: https://www.atlassian.com/git/tutorials/using-branches git
tag: https://www.atlassian.com/git/tutorials/inspecting-a-repository/git-taggit
“Bible”: https://git-scm.com/book/en/v2