Open main menu

DAVE Developer's Wiki β

Changes

MISC-TN-028: GitLab-based workflow

703 bytes added, 20:42, 16 August 2023
no edit summary
==Introduction==
DAVE Embedded Systems uses GitLab as the primary source code management platform. This Technical Note describes the typical GitLab-based workflow we use and that our partners are strongly encouraged to adopt as well.
==Essential steps of the workflow==
In this case, we call the issue "First release" as shown by the following picture:
Then, we create a merge request associated with the issue. We instruct GitLab to automatically create a branch associated with this issue as well. The branch will be called <code>1-first-release</code> and its source branch is <code>main</code>. This means then when the merge request is accepted, the new code in the branch <code>1-first-release</code> will be merged into the branch <code>main</code>. Please note that the merge options are so that the branch will be deleted when the merge request is accepted. This usually makes sense because we don't need to keep the branch we the job is done. If you are asking, don't worry: although the branch will be deleted, commits will not be lost. Therefore, the history of changes will be preserved.
On GitLab side everything is in place, so we can work on our local host to write our code. For the sake of simplicity, we will just edit one file, README.md.
Of course, the first step consists of cloning the repository:
<pre class="workstation-terminal">
$ git clone git@gitlab.com:DAVEEmbeddedSystems/test/test0.git
Cloning into 'test0'...
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (3/3), done.
</pre>
 
Thea, we checkout the branch named <code>1-first-release</code>:
<pre class="workstation-terminal">
$ cd test0/
/test0$ git branch -a
drwxrwxr-x 8 llandre llandre 4096 ago 16 22:07 .git/
-rw-rw-r-- 1 llandre llandre 0 ago 16 22:06 README.md
</pre>
 
We edit the README.md file with our favorite editor, then we commit our changes and push them to the remote repository:
<pre class="workstation-terminal">
/test0$ git diff
diff --git a/README.md b/README.md
To gitlab.com:DAVEEmbeddedSystems/test/test0.git
e382410..ce31afa 1-first-release -> 1-first-release
</pre>
 
We can now move back to GitLab-side and close the merge request.
4,650
edits