"Git is a version control system for tracking changes in computer files and coordinating work on those files among multiple people. It is primarily used for source code management in software development, but it can be used to keep track of changes in any set of files. As a distributed revision control system, it is aimed at speed, data integrity, and support for distributed, non-linear workflows." Source : https://en.wikipedia.org/wiki/Git
GitLab is basically a web-based Git repository manager (see https://about.gitlab.com).
Polytech/EII has an installed GitLab platform available here : https://gitlab.polytech.umontpellier.fr
You should be able to connect with your Polytech regular login/password.
Atollic comes with eGit, an integrated Eclipse plugin that can manage Git requests. You may prefer Git command lines... but this tutorial introduces a very simple approach to using GitLab to archive your project, track changes in source code, and collaborate with other developers.
In order to have Atollic working with GitLab, one must first setup an authentication mechanism which links your Atollic session to your GitLab account with some degree of security. This is done by means of a SSH-RSA key pair (public/private).
Open Window → Preferences and go to the General → Network Connections → SSH2 category:
SSH2 home is the local folder to store private keys. If you're using your own computer the default path is OK.
When using school computers, you should set the SSH2 home to somewhere in your P:\ folder (e.g. P:\.ssh). Doing so, you will be able to access GitLab from any workstation in the school.
Next, open the Key Management tab. Click the Generate RSA Key... button.
Then click the Save Private Key... button.
You can ignore the Passphrase, and authorize the .ssh folder creation. Leave the key name as proposed "id_rsa", without any extension.
This will save the private key into your "SSH2 home" local folder (or on your P:\ drive).
You can make sure by navigating to this folder :
Now in the Gitlab web interface go to your user Settings:
You’ll end up with an empty new project as shown below. Leave this page open, but put the navigator window aside for the moment.
From the project contextual menu, go to Team→Share Project...
The next step is to configure the local Git Repository that will keep track of code history on your computer. Although this is not recommended, a simple approach is to have a local repository for each individual project. To achieve this, , just select Use or create repository in parent folder of project, then select the project name, and then click the button Create Repository.
The Commit command is used to save your project changes to the local Git repository.
Launch the Commit action
In the Git Staging panel that opens, select all the Unstaged Changes files (CTRL-A) and drag them into the Staged Changes field. Then enter a Commit Message (mandatory) which describes the purpose of committing.
Again, Project Explorer items look different. Actual display tells you that current project files are in sync with the Git repository information (i.e. no file has been modified since last commit).
Let-us edit main.c and change a little something in the source code. You can for instance modify the delay of the LED ON state.
The initial code:
/*
* main.c
*
* Created on: 16 août 2018
* Author: Laurent
*/
#define DELAY_ON 20000
#define DELAY_OFF 100000
#include "stm32f0xx.h"
int main(void)
{
...
}
/*
* main.c
*
* Created on: 16 août 2018
* Author: Laurent
*/
#define DELAY_ON 50000 // <-- Longer Delay here
#define DELAY_OFF 100000
#include "stm32f0xx.h"
int main(void)
{
...
}
Save all and build
the project. Make sure the build succeeds...
Project Explorer now shows changes by means of the ‘>’ character applied to the tree structure app/src/main.c :
In the Git Staging panel, you can see that only main.c is now considered for staging. Enter a Commit Message that describes the purpose of committing, and then click the
Commit button.
Open Team → Show in History
Select the second commit, and then main.c. You get a detailed view of what has been done:
Open Team → Show in Repositories View
Then, in the Git Repositories panel, Right-Click Remote and select Create Remote…
Give the name you want to the remote server. Select Configure push, and then click OK.
In the next window, click the Change button right to the URI text field. You'll end up with the Select a URI window.
Go back to your Gitlab navigator window, open the project you want to use as a remote repository and click the Copy URL to clipboard button under the Clone button.
In the following tutorials, every time you see this box, you have to commit current project state and then push into a dedicated repository on Gitlab. This special remote repository is provided and owned by teacher, but you'll have maintainer rights so you can basically do whatever you want. It is used to monitor your progression.
This is part of the evaluation process, and since Gitlab info extraction is automated, it is mandatory to use the indicated commit name. Copy/paste that name (without " ") into the Commit Message field of the Git Staging panel.
For example, if the box says so:
![]() |
![]() ![]() |
Commit the project using Commit name as Commit Message as shown here:
For the very first commit (coming next), you'll have to configure the remote repository as explained in the above tutorial, using URI obtained from the remote repository. Then, you'll be able to execute first Push. This will create the master branch onto Gitlab repository.
You only need to configure the remote repository once. We'll use the same project all along the tutorials. For second commit and further, you may simply Commit & Push each time you pass by the red box.
Last advices: