<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Git on Software Factory</title><link>/tags/git/</link><description>Recent content in Git on Software Factory</description><generator>Hugo</generator><language>en</language><atom:link href="/tags/git/index.xml" rel="self" type="application/rss+xml"/><item><title>Source Code Management</title><link>/use/practices/code/scm/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/use/practices/code/scm/</guid><description>&lt;p&gt;Source Code Management (SCM) is a set of practices for tracking and managing changes to code,
enabling teams to collaborate effectively and maintain a clear project history.&lt;/p&gt;
&lt;p&gt;This guide provides an overview of SCM best practices, helping your team maintain a clear project history,
collaborate effectively, and deliver high-quality code.&lt;/p&gt;
&lt;p&gt;From branching strategies and commit conventions to merge types and tagging,
these practices will ensure cohesive teamwork and a well-organized codebase.&lt;/p&gt;</description></item><item><title>Branching</title><link>/use/practices/code/scm/branch/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/use/practices/code/scm/branch/</guid><description>&lt;p&gt;&lt;img src="../img/git-branch-logo.png" alt="“Branching”"&gt;&lt;/p&gt;
&lt;h2 id="introduction"&gt;Introduction&lt;a class="td-heading-self-link" href="#introduction" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A branch is a diverging point in the codebase that allows for parallel development.
It enables developers to work on different features, fixes, or updates independently
of the main code line, known as the main branch.&lt;/p&gt;
&lt;p&gt;Branching is a fundamental concept in Source Code Management (SCM) systems.
In the Software Factory, we use &lt;strong&gt;Git&lt;/strong&gt; as our SCM tool,
which provides powerful and lightweight branching capabilities.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;To gain a deeper understanding of Git&amp;rsquo;s branching model, please read &lt;a href="https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell#ch03-git-branching" class="external-link" target="_blank" rel="noopener noreferrer"&gt;Git Branching in a Nutshell&lt;/a&gt;
.&lt;/p&gt;</description></item><item><title>Code Review</title><link>/use/practices/code/code-review/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/use/practices/code/code-review/</guid><description>&lt;h2 id="objective--benefits"&gt;Objective &amp;amp; Benefits&lt;a class="td-heading-self-link" href="#objective--benefits" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Code review is a systematic examination of source code intended to find and fix mistakes overlooked
in the initial development phase, improving the overall quality of software.&lt;/p&gt;
&lt;p&gt;Key benefits include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Improved code quality&lt;/strong&gt;: Catches bugs early in the development cycle&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Knowledge sharing&lt;/strong&gt;: Facilitates learning and cross-pollination of ideas within the team&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Consistency&lt;/strong&gt;: Ensures adherence to coding standards and best practices&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Collective ownership&lt;/strong&gt;: Increases shared understanding of the codebase&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mentorship&lt;/strong&gt;: Provides opportunities for junior developers to learn from seniors&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="practice-description"&gt;Practice Description&lt;a class="td-heading-self-link" href="#practice-description" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Code review is a systematic process where one or more developers examine another developer&amp;rsquo;s code changes
before these changes are integrated into the main codebase.
The primary goal is to ensure code quality, catch potential issues early,
and share knowledge within the team.&lt;/p&gt;</description></item><item><title>Committing</title><link>/use/practices/code/scm/commit/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/use/practices/code/scm/commit/</guid><description>&lt;p&gt;&lt;a href="https://xkcd.com/1296/" class="external-link" target="_blank" rel="noopener noreferrer"&gt;&lt;img src="../img/xkcd.png" alt="“Committing”"&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;h2 id="introduction"&gt;Introduction&lt;a class="td-heading-self-link" href="#introduction" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A commit is a snapshot of changes made to the files in your repository.
Commits are more than just snapshots — they tell the story of your project.
A clear and well-structured commit history helps others (and future you) understand
what changed, when, and why.
It simplifies debugging, eases code reviews, and makes collaboration more effective.&lt;/p&gt;
&lt;p&gt;In the Software Factory, we use &lt;strong&gt;Git&lt;/strong&gt; as our SCM tool.
The practices described here apply to any SCM system,
while Git-specific features are highlighted where relevant.&lt;/p&gt;</description></item><item><title>Git</title><link>/use/tools/git/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/use/tools/git/</guid><description>&lt;div style="display: flex; align-items: flex-start; gap: 1.5rem; margin-bottom: 1rem; max-width: 80%;"&gt;
 &lt;img src="./img/Git-Logo-1788C.svg" alt="Git"
 width="150"
 style="flex-shrink: 0;"&gt;
 &lt;div&gt;&lt;p&gt;Git is a distributed version control system designed to handle everything from small
to very large projects with speed and efficiency. Unlike centralized version control systems,
Git allows every developer to have a full copy of the project history stored locally.&lt;/p&gt;
&lt;p&gt;This decentralization enables seamless collaboration and efficient handling of branches and merges.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;


 &lt;link rel="stylesheet" href="/css/vendors/admonitions.css"&gt;
 &lt;div class="admonition note"&gt;
 &lt;div class="admonition-header"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"&gt;&lt;path d="M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 125.7-86.8 86.8c-10.3 10.3-17.5 23.1-21 37.2l-18.7 74.9c-2.3 9.2-1.8 18.8 1.3 27.5L64 512c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128zM549.8 235.7l14.4 14.4c15.6 15.6 15.6 40.9 0 56.6l-29.4 29.4-71-71 29.4-29.4c15.6-15.6 40.9-15.6 56.6 0zM311.9 417L441.1 287.8l71 71L382.9 487.9c-4.1 4.1-9.2 7-14.9 8.4l-60.1 15c-5.5 1.4-11.2-.2-15.2-4.2s-5.6-9.7-4.2-15.2l15-60.1c1.4-5.6 4.3-10.8 8.4-14.9z"/&gt;&lt;/svg&gt;
 &lt;span&gt;Note&lt;/span&gt;
 &lt;/div&gt;
 &lt;div class="admonition-content"&gt;
 &lt;p&gt;For &lt;strong&gt;S&lt;/strong&gt;ofware &lt;strong&gt;C&lt;/strong&gt;ode &lt;strong&gt;M&lt;/strong&gt;anagement (SCM) best practices (branching strategies, commit
conventions, merge types, tagging),
refer to the &lt;a href="/use/practices/code/scm/"&gt;SCM Practices&lt;/a&gt;
 section.&lt;/p&gt;</description></item><item><title>Git clean history</title><link>/use/howto/code/git-clean-history/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/use/howto/code/git-clean-history/</guid><description>&lt;h2 id="concept"&gt;Concept&lt;a class="td-heading-self-link" href="#concept" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;This guide explains how to clean up your branch’s Git history.
A clean history makes code reviews easier, reduces merge conflicts, and keeps the main branch
readable.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Remove noisy commits like &lt;code&gt;fix bug&lt;/code&gt;, &lt;code&gt;wip&lt;/code&gt;, &lt;code&gt;debug&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Group related changes into meaningful commits.&lt;/li&gt;
&lt;li&gt;Make the history easier to understand for reviewers.&lt;/li&gt;
&lt;/ul&gt;

 &lt;link rel="stylesheet" href="/css/vendors/admonitions.css"&gt;
 &lt;div class="admonition warning"&gt;
 &lt;div class="admonition-header"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"&gt;&lt;path d="M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480L40 480c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24l0 112c0 13.3 10.7 24 24 24s24-10.7 24-24l0-112c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"/&gt;&lt;/svg&gt;
 &lt;span&gt;Warning&lt;/span&gt;
 &lt;/div&gt;
 &lt;div class="admonition-content"&gt;
 &lt;p&gt;&lt;strong&gt;Be careful when rebasing shared branches.&lt;/strong&gt;&lt;br&gt;
Rebasing rewrites commit history,
which can cause problems for other developers working on the same branch.&lt;br&gt;
Before rebasing a shared branch,
make sure you coordinate with your team and communicate clearly.&lt;br&gt;
When in doubt, prefer rebasing only your local feature branches before they are pushed.&lt;/p&gt;</description></item><item><title>GitLab Merge Request</title><link>/use/howto/code/gitlab-merge-request/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/use/howto/code/gitlab-merge-request/</guid><description>&lt;h2 id="approval-rules"&gt;Approval rules&lt;a class="td-heading-self-link" href="#approval-rules" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Create a list of users who act as code owners for specific files and require their approval
before merging work.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In the root of your repository, create (if not exist) a new directory &lt;code&gt;.gitlab/&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Create a file &lt;code&gt;CODEOWNERS&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;set the rules based on this exemple :&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;## Code Owners for a file&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="l"&gt;filename-path @username1 @username2&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;## Code Owners for a directory&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="l"&gt;directory-path/ @username1 @username2&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;## All group members as Code Owners for a file&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="l"&gt;filename @groupname&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="merge-checks"&gt;Merge Checks&lt;a class="td-heading-self-link" href="#merge-checks" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;To configure checks behavior :&lt;/p&gt;</description></item><item><title>LFS</title><link>/use/practices/code/scm/lfs/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/use/practices/code/scm/lfs/</guid><description>&lt;p&gt;&lt;img src="../img/git-lfs.png" alt="“LFS”"&gt;&lt;/p&gt;
&lt;h2 id="understanding-git-lfs"&gt;Understanding Git LFS&lt;a class="td-heading-self-link" href="#understanding-git-lfs" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://git-lfs.com/" class="external-link" target="_blank" rel="noopener noreferrer"&gt;Git Large File Storage&lt;/a&gt;
 (LFS) is a Git extension that handles large binary files
more efficiently by storing them separately from your Git repository.&lt;/p&gt;
&lt;h3 id="the-problem"&gt;The problem&lt;a class="td-heading-self-link" href="#the-problem" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Git stores every version of every file. This creates issues with large binary file:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Repository can grow rapidly&lt;/li&gt;
&lt;li&gt;Slow clone/fetch operations&lt;/li&gt;
&lt;li&gt;Wastes bandwidth and disk space&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This becomes a bottleneck in workflows during cloning and fetching repositories with large binary files.&lt;/p&gt;</description></item><item><title>Merging</title><link>/use/practices/code/scm/merge/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/use/practices/code/scm/merge/</guid><description>&lt;p&gt;&lt;img src="../img/git-merge-logo.png" alt="Merge logo"&gt;&lt;/p&gt;
&lt;h2 id="introduction"&gt;Introduction&lt;a class="td-heading-self-link" href="#introduction" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Merging is the process of combining changes from different branches into a single branch.
It is a fundamental operation in any SCM workflow, allowing teams to integrate work from multiple developers.
Selecting the right merge approach is crucial for maintaining a clean and understandable project history.&lt;/p&gt;
&lt;p&gt;In the Software Factory, we use &lt;strong&gt;Git&lt;/strong&gt; for source code management.
The examples below show Git commands, but the concepts apply to any modern SCM system.&lt;/p&gt;</description></item><item><title>Merge Requests</title><link>/use/practices/code/merge-request/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/use/practices/code/merge-request/</guid><description>&lt;h2 id="objectives--benefits"&gt;Objectives &amp;amp; Benefits&lt;a class="td-heading-self-link" href="#objectives--benefits" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Merge requests (MRs) are a critical component in the software development life cycle (SDLC)
specially in the &lt;a href="/use/practices/code/scm/branch/#branching-strategies"&gt;GitLab workflow&lt;/a&gt;
.&lt;/p&gt;
&lt;p&gt;They allow developers to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Propose &lt;strong&gt;code changes&lt;/strong&gt; from feature branches to be merged into the main branch.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Get feedback&lt;/strong&gt; from team members as part of &lt;a href="/use/practices/code/code-review/"&gt;code review&lt;/a&gt;
 workflows.&lt;/li&gt;
&lt;li&gt;Enable &lt;strong&gt;approval and check gates&lt;/strong&gt; before integrating changes into the main codebase.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Merge Requests improve regular &lt;strong&gt;collaboration&lt;/strong&gt; and &lt;strong&gt;team spirit&lt;/strong&gt;
because they serve as &lt;em&gt;educational moments&lt;/em&gt; and foster &lt;em&gt;team effort&lt;/em&gt;.&lt;/p&gt;</description></item><item><title>Secure your Repository</title><link>/use/practices/secure/secure-your-repository/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/use/practices/secure/secure-your-repository/</guid><description>&lt;p&gt;Securing your repository is essential to maintain the integrity and confidentiality of your code base.
This guide covers the practices for implementing robust access controls, enforcing branch protection,
securing secrets, and using groups efficiently within GitLab.&lt;/p&gt;
&lt;h2 id="implement-access-controls"&gt;Implement Access Controls&lt;a class="td-heading-self-link" href="#implement-access-controls" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Establishing strong access controls is fundamental for repository security.&lt;/p&gt;
&lt;p&gt;Properly configured permissions ensure only authorized individuals can perform sensitive actions
like pushing code, merging changes, or altering project settings.&lt;/p&gt;</description></item><item><title>Tagging</title><link>/use/practices/code/scm/tag/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/use/practices/code/scm/tag/</guid><description>&lt;p&gt;&lt;img src="../img/git-tag-logo.png" alt="tag logo"&gt;&lt;/p&gt;
&lt;h2 id="introduction"&gt;Introduction&lt;a class="td-heading-self-link" href="#introduction" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Tagging is a crucial practice in software development to mark important points in the project history,
such as versions, releases, or milestones.
Tags provide a way to capture a snapshot of your codebase at a specific moment,
making it easy to reference and retrieve that exact state later.&lt;/p&gt;
&lt;p&gt;In the Software Factory, we use &lt;strong&gt;Git&lt;/strong&gt; for source code management.
Git tags are references that point to specific commits, helping to mark significant points
in your project&amp;rsquo;s history.&lt;/p&gt;</description></item></channel></rss>