Git

All template repositories, examples, tools, libraries and documentation can be found on the BFH TI GitLab server in the Leguan Organization.

Set up GitLab Account

To test whether the key was setup correctly on both your system and GitLab, enter the following command in your Terminal:

$ ssh git@gitlab.ti.bfh.ch

  Welcome to GitLab, @<USERNAME>!
  Connection to gitlab.ti.bfh.ch closed.

Get repository URL

../_images/Screenshot_Clone.png

Clone via Web-UI

The template project can be imported into your personal GitLab-Workspace. Enter the URL to the repository into the Git repository URL field and your BFH username and password into the two fields below. Finally, you need to enter a name for your project at the bottom.

../_images/Screenshot_ImportProject.png

Clone locally via SmartGit

To work locally with Git, it’s recommended to use a GUI client such as GitKraken, GitFork or SmartGit. However it’s also possible to use the git command line tool directly.

In SmartGit this can be done by choosing Repository -> Clone and entering the previously copied path into the Repository URL field. GitKraken and GitFork work similarly.

../_images/Screenshot_Smartgit_Clone.png

Import project into STM32CubeIDE

After cloning a repository, you can directly import it into the STM32CubeIDE workspace.

  • File->Import…

  • Choose Existing Projects into Workspace

  • Select Browse… and choose the project to import

  • Click on Import

../_images/Screenshot_STM32Cube_Import.png

Working with Git

To use git efficiently, every new distinct feature, bugfix or improvement should be saved on GitLab by creating a new commit and pushing it to the git server. You don’t need to create a new commit every time you modified a line. However, it’s best to create a commit every time you’ve finished a task and start working on another one.

To create a new commit, use one of the tools mentioned above. The following instructions are for SmartGit, however the other tools work identically.

  • Choose your repository

  • All changes that have been made since the last commit are now being displayed and can be checked

  • Once you’re sure they’re correct, enter a commit message that describes the changes you’ve made and click on Commit

  • To upload the new change to the GitLab server, click on the Push button

  • If multiple people are working on the same repository, always click on Pull first to download and merge the latest changes with your local changes before creating a new commit and clicking on Push again.

To learn more about git, read https://git-scm.com/