<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.dolibarr.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Alexis+BERNARD</id>
	<title>Dolibarr ERP CRM Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.dolibarr.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Alexis+BERNARD"/>
	<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php/Special:Contributions/Alexis_BERNARD"/>
	<updated>2026-10-25T03:27:16Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=FAQ_R%C3%A9cup%C3%A9rer,_mettre_%C3%A0_jour_les_sources_GIT_du_projet&amp;diff=46409</id>
		<title>FAQ Récupérer, mettre à jour les sources GIT du projet</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=FAQ_R%C3%A9cup%C3%A9rer,_mettre_%C3%A0_jour_les_sources_GIT_du_projet&amp;diff=46409"/>
		<updated>2020-02-28T12:31:44Z</updated>

		<summary type="html">&lt;p&gt;Alexis BERNARD: Traduction en français de certain textes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- BEGIN interlang links --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Do NOT edit this section&lt;br /&gt;
     Links below are automatically managed by PolyglotBot&lt;br /&gt;
     You can edit links on the English source page : FAQ_Get,update_GIT_project_sources --&amp;gt;&lt;br /&gt;
[[en:FAQ_Get,update_GIT_project_sources]]&lt;br /&gt;
[[es:FAQ_Recuperar,_actualizar_GIT_fuentes_del_proyecto]]&lt;br /&gt;
&amp;lt;!-- END interlang links --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ FR]]&lt;br /&gt;
{{TemplateDocDevFr}}&lt;br /&gt;
Voici les informations sur comment récuperer et travailler avec les sources du projet Dolibarr.&lt;br /&gt;
&lt;br /&gt;
=Recevoir la dernière version des sources par téléchargement=&lt;br /&gt;
Cette méthode vous permet de recevoir les sources de la branche de développement principale (Appelée HEAD). Cette opération consiste à récupérer la dernière version des fichiers de l&#039;application Dolibarr qui sont compilées chaque nuit dans un fichier tgz. Ce fichier est disponible par le lien suivant:&lt;br /&gt;
&lt;br /&gt;
{{LinkLastSnapshot}}&lt;br /&gt;
&lt;br /&gt;
Les nouveaux fichiers écrasent les anciens. Le problème de cette méthode est qu&#039;il faut télécharger et décompresser chaque fois le paquet dès que l&#039;on souhaite recevoir des mises à jour.&lt;br /&gt;
&lt;br /&gt;
=Recevoir la dernière version des sources en utilisant un accès anonyme GIT.=&lt;br /&gt;
==Prérequis==&lt;br /&gt;
&lt;br /&gt;
*Avec l&#039;IDE Eclipse&lt;br /&gt;
&lt;br /&gt;
Premièrement, vous devez avoir une installation fonctionnelle de Eclipse. Le plugin &#039;&#039;&#039;EGit&#039;&#039;&#039; doit aussi être installé.&lt;br /&gt;
Pour l&#039;installer, utilisez &#039;&#039;&#039;Help&#039;&#039;&#039; depuis le menu Eclipse puis cliquez sur &#039;&#039;&#039;Install new software&#039;&#039;&#039;et cliquez sur &#039;&#039;&#039;Available software site&#039;&#039;&#039;. Dans la liste des adresses qui apparait, recherchez le lien :&lt;br /&gt;
 http://download.eclipse.org/egit/updates&lt;br /&gt;
Puis, choisissez d&#039;installer &#039;&#039;&#039;EGit&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
*Avec le client GIT en ligne de commande&lt;br /&gt;
&lt;br /&gt;
Pour récuperer les sources dans l&#039;intention de les modifier, vous avez besoin d&#039;un compte GitHub, et un client GIT (Les outils GIT en ligne de commande Linux, ou le client GIT d&#039;Eclipse).&lt;br /&gt;
&lt;br /&gt;
==Processus de Clone==&lt;br /&gt;
{{ToTranslate}}&lt;br /&gt;
First, enter value of the repository with reference sources into your GIT client tool.&lt;br /&gt;
&lt;br /&gt;
*Avec l&#039;IDE Eclipse, choose &amp;quot;Clone GIT repository&amp;quot;. Enter GIT URL of project to get.&lt;br /&gt;
&lt;br /&gt;
GIT Url for Dolibarr official source is:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
git@github.com:Dolibarr/dolibarr.git&lt;br /&gt;
or&lt;br /&gt;
git://github.com/Dolibarr/dolibarr.git (lecture seule)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Your Eclipse GIT client will ask you to choose the branches you are interesting in. Branches not selected now could be selected later by doing a &amp;quot;Fetch&amp;quot; from the &amp;quot;Remotes&amp;quot; view, but try to choose only the branch you need. This will save you time and problems later.&lt;br /&gt;
&lt;br /&gt;
*Avec le client GIT en ligne de commande:&lt;br /&gt;
&lt;br /&gt;
First setup your git client:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git config --global user.name &amp;quot;Your Name&amp;quot;&lt;br /&gt;
git config --global user.email &amp;quot;user@domain.com&amp;quot;&lt;br /&gt;
git config --list&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Then clone repository locally:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone git://github.com/Dolibarr/dolibarr.git dolibarr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
And, if you are behind a firewall, you can user the alternate URL:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git config --global http.proxy http://proxyuser:proxypass@proxyserver:proxyport&lt;br /&gt;
git clone https://gitlogin:gitpassword@github.com/Dolibarr/dolibarr.git dolibarr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this step is validated, your GIT client will download all files from remote GIT server. This may last several seconds or minutes.&lt;br /&gt;
&lt;br /&gt;
Once download is finished, go into GIT view - Branches - Local. In most cases, the branch you choosed should be already available.&lt;br /&gt;
&lt;br /&gt;
If not:&lt;br /&gt;
&lt;br /&gt;
*Avec Eclipse, right click on &amp;quot;Branches - Remotes - The branch you want to duplicate locally&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If you choose &amp;quot;Create Branch&amp;quot;, this will duplicate content of branch to work on it locally.&lt;br /&gt;
If you Choose &amp;quot;Checkout&amp;quot;, this will update the view &amp;quot;Working Directory&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
*With GIT on Command Line Interface&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git checkout develop&lt;br /&gt;
git checkout x.y&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This will create local branch and make checkout automatically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If using Eclipse, once your branch is created locally, create a PHP project from assistant by choosing &amp;quot;&#039;&#039;&#039;Create from existing project&#039;&#039;&#039;&amp;quot; and select directory that is your GIT local repository (Do not choose to create a PHP project from scratch).&lt;br /&gt;
Then right click on project from your Eclipse workspace and Choose &amp;quot;&#039;&#039;&#039;Team - Share&#039;&#039;&#039;&amp;quot;. Select GIT and click on option &amp;quot;&#039;&#039;&#039;Use or create repository in parent folder of project&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
An alternate method is File-&amp;gt;Import, Git-&amp;gt;Project from Git, Select the Git repository and Next, Use New project Wizard -&amp;gt; Php project, enter the folder of you GIT local repository.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, you can setup Eclipse to avoid it to scan all project files for its build tools (Outline scanner, TODO scanner, syntax scanner...). This will avoid Eclipse to be too slow. For this, right click on project, choose Build Path and setup it like into following screenshot.&lt;br /&gt;
&lt;br /&gt;
[[File:Eclipse php build path.png|240px]]&lt;br /&gt;
&lt;br /&gt;
=Récupérer la dernière version des sources avec un accès GIT complet=&lt;br /&gt;
==Prérequis==&lt;br /&gt;
First you must have a working install of Eclipse. &#039;&#039;&#039;EGit&#039;&#039;&#039; plugin must also have been installed.&lt;br /&gt;
For this, use the &#039;&#039;&#039;Find And Install process&#039;&#039;&#039; into Eclipse menu, add the GIT update URL: &lt;br /&gt;
 http://download.eclipse.org/egit/updates&lt;br /&gt;
Then choose to install &#039;&#039;&#039;EGit&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
You must before create an account on GitHub (https://github.com/) and upload a public RSA or DSA certificate into your account profile.&lt;br /&gt;
&lt;br /&gt;
==Processus de clone==&lt;br /&gt;
Le processus est le même que pour récupérer les sources de manière anonyme (voir ci-dessus), seule l&#039;URL d&#039;accès change.&lt;br /&gt;
&lt;br /&gt;
URL à utiliser pour le clonage GIT:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
git@github.com:Dolibarr/dolibarr.git&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Noter que une URL HTTP est aussi disponible mais est parfois hors service (aussi prenez de préférence la méthode précédente):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
https://yourgitlogin@github.com/Dolibarr/dolibarr.git&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Mettre à jour votre repository=&lt;br /&gt;
Pour mettre à jour votre espace de travail local, faites un clic droit sur le projet Eclipse et sélectionnez &amp;quot;Pull&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Si vous avez apporté des modifications à votre espace de travail Eclipse sur des fichiers qui ont été modifiés dans la référence distante GIT, votre client GIT effectuera un merge automatiquement.&lt;br /&gt;
&lt;br /&gt;
*S&#039;il y a des conflits, le merge marquera tous les fichiers en conflit comme &amp;quot;conflit&amp;quot; (Voir plus loin pour résoudre cet état).&lt;br /&gt;
*Sinon, vous obtiendrez tous les nouveaux fichiers de version, y compris toutes vos modifications.&lt;br /&gt;
&lt;br /&gt;
If you already have commited some files into your local repository, your workspace will be marked as &amp;quot;Merged&amp;quot;.&lt;br /&gt;
All you have to do is make a commit to validate your local repository as including your changes and changes made by others.&lt;br /&gt;
&lt;br /&gt;
=Validez et publiez vos modifications=&lt;br /&gt;
Pour voir toutes les modifications que vous avez apportées à votre répertoire de travail et en attente d&#039;être ajoutées à Git:&lt;br /&gt;
&lt;br /&gt;
*Avec l&#039;interface &amp;gt;GIT en ligne de commande:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git status&lt;br /&gt;
git diff subdir/filename&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To add changes made into your local repository into the GIT index, then commit this index :&lt;br /&gt;
&lt;br /&gt;
*With Eclipse: Right click on file or directory to commit. Select file to add/remove/update into commit.&lt;br /&gt;
*With GIT Command Line Interface:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git commit -a -m &amp;quot;Commit text&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This will save add and changes into your local branch.&lt;br /&gt;
&lt;br /&gt;
To push them on the GIT repository server,&lt;br /&gt;
&lt;br /&gt;
*With Eclipse: right click on project and choose &amp;quot;&#039;&#039;&#039;Team - Push to Upstream&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
*With GIT Command Line Interface:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git push&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To cancel a commit:&lt;br /&gt;
&lt;br /&gt;
*With GIT Command Line Interface:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git revert IdCommit  or  git revert HEAD  (for last commit)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Ajout un commit exterieur dans votre repository courant=&lt;br /&gt;
Some developers may work and do commit into their own Git repository after forking the project. If you are interesting into getting this changes, you can import them with the following steps with Eclipse:&lt;br /&gt;
&lt;br /&gt;
*First, go into GIT setup view and right click on &amp;quot;&#039;&#039;&#039;Remotes&#039;&#039;&#039;&amp;quot; of your Eclipse Git working space and choose &amp;quot;&#039;&#039;&#039;Create a remote...&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
*Type name or remote fork the developer has create (in most cases, it&#039;s developer Git login). For example: &amp;quot;&#039;&#039;&#039;thedevlogin&#039;&#039;&#039;&amp;quot;. Choose also &amp;quot;&#039;&#039;&#039;Configure Fetch&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
*Type URI of Git repository of developer. For example: &#039;&#039;&#039;git://github.com/thedevlogin/dolibarr.git&#039;&#039;&#039;. Also add a refspec value to declare the branch you want to get. For example: &#039;&#039;&#039;refs/heads/master:refs/remotes/thedevlogin/master&#039;&#039;&#039;. Click &amp;quot;&#039;&#039;&#039;Save and Fetch&#039;&#039;&#039;&amp;quot;. A new entry will be added into &amp;quot;Remote Tracking&amp;quot; making possible to read/get commits done into this branch.&lt;br /&gt;
&lt;br /&gt;
Now, go on command line of your git repository (in most cases on Linux, it&#039;s &#039;&#039;&#039;/home/yourlogin/git/yourdolibarr&#039;&#039;&#039;) and type the git cherry-pick command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git cherry-pick -x commitid&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
where commitid is value of commit id you want to get.&lt;br /&gt;
&lt;br /&gt;
Once this is done, go back to Eclipse and make a refresh on project. You will see modified files appears with decorators (with conflicts if there is).&lt;br /&gt;
&lt;br /&gt;
It the cherry-pick fails because of conflicts, you can cancel the cherry-pick try with&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git cherry-pick --abort&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Résoudre un conflit=&lt;br /&gt;
Si un fichier est marqué en &amp;quot;Conflit&amp;quot; après un &amp;quot;Pull&amp;quot;, ouvrez le fichier et éditez le.&lt;br /&gt;
Rechercher la chaine &amp;quot;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;quot;, vous verrez la partie de code en conflit entre &amp;quot;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;quot; et &amp;quot;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;quot;. Editer manuellement les lignes de codes pour avoir le résultat finale en supprimant également les &amp;quot;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;quot; et &amp;quot;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Ensuite, faire un click droit sur le fichier puis choisir &amp;quot;Add&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Si vous préférez annuler complètement toutes les modifications que vous avez apportées à tous les fichiers (afin de restaurer votre espace de travail avec le contenu du repository distant), vous pouvez effectuer une réinitialisation:&lt;br /&gt;
&lt;br /&gt;
*Avec Eclipse, faites un clic droit sur la ligne supérieure du projet et sélectionnez &amp;quot;Réinitialiser&amp;quot; puis &amp;quot;&#039;&#039;&#039;Hard&#039;&#039;&#039;&amp;quot; then &amp;quot;&#039;&#039;&#039;Reference - HEAD&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
*En utilisant l&#039;outil de ligne de commande GIT, vous pouvez y parvenir avec la commande&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git reset --hard HEAD &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Tagguer les sources=&lt;br /&gt;
Avec les outils en Ligne de Commande GIT:&lt;br /&gt;
&lt;br /&gt;
Pour créer un tag sur une version:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git tag -a -m &amp;quot;Release|Maintenance release x.y.z&amp;quot; &amp;quot;x.y.z&amp;quot;&lt;br /&gt;
or&lt;br /&gt;
git tag -a -f -m &amp;quot;Beta x.y.betai&amp;quot; &amp;quot;x.y.betai_YYYYMMDD&amp;quot; idcommit   # -f force si un tag existe déjà, idcommit permet de choisir le commit à tagguer&lt;br /&gt;
&lt;br /&gt;
git push --tags   # Pour pousser le tags sur le serveur distant&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pour supprimer un tag:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git tag -d &amp;quot;x.y.z_YYYYMMDD&amp;quot;&lt;br /&gt;
git push origin :x.y.z_YYYYMMDD    # Pour valider la suppression sur le serveur distant&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Créer une nouvelle branche=&lt;br /&gt;
Voici la commande à utiliser pour créer une nouvelle branche depuis un repository propre develop:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git branch x.y&lt;br /&gt;
git push origin x.y&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Statistiques=&lt;br /&gt;
Avec les outils en Ligne de Commande GIT:&lt;br /&gt;
&lt;br /&gt;
Pour compter le nombre de changerment qu&#039;un développeur a fait entre une version x et y:&lt;br /&gt;
&lt;br /&gt;
*First, run git merge-base to know the id of last common commit between x and y&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git merge-base origin/3.1 origin/develop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Then run git log to have list of all changes from last common commit to last commit&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git log id_found_at_previous_step..HEAD&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*To get total number of added/deleted lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git log --ancestry-path --numstat --pretty=&amp;quot;%H&amp;quot; id_found_at_previous_step..HEAD | awk &#039;NF==3 {plus+=$1; minus+=$2} END {printf(&amp;quot;+%d, -%d\n&amp;quot;, plus, minus)}&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To count number of changes finally between a version x and y (it differs from previous count because in previous count, a change can be done 2 times at two different moment to change differently. With second method, you count change finally found if changes were ok at first try):&lt;br /&gt;
&lt;br /&gt;
*Use same method than previously but instead of running git log, run git diff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git diff -b -M --numstat --pretty=&amp;quot;%H&amp;quot; id_found_at_previous_step..HEAD | awk &#039;NF==3 {plus+=$1; minus+=$2} END {printf(&amp;quot;+%d, -%d\n&amp;quot;, plus, minus)}&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plus d&#039;information sur l&#039;utilisation de GIT disponible [http://wiki.eclipse.org/EGit/User_Guide ici].&lt;/div&gt;</summary>
		<author><name>Alexis BERNARD</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=FAQ_R%C3%A9cup%C3%A9rer,_mettre_%C3%A0_jour_les_sources_GIT_du_projet&amp;diff=46408</id>
		<title>FAQ Récupérer, mettre à jour les sources GIT du projet</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=FAQ_R%C3%A9cup%C3%A9rer,_mettre_%C3%A0_jour_les_sources_GIT_du_projet&amp;diff=46408"/>
		<updated>2020-02-28T11:01:12Z</updated>

		<summary type="html">&lt;p&gt;Alexis BERNARD: Titre d&amp;#039;une partie (test de modification avant de poursuivre la traduction de la doc en français)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- BEGIN interlang links --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Do NOT edit this section&lt;br /&gt;
     Links below are automatically managed by PolyglotBot&lt;br /&gt;
     You can edit links on the English source page : FAQ_Get,update_GIT_project_sources --&amp;gt;&lt;br /&gt;
[[en:FAQ_Get,update_GIT_project_sources]]&lt;br /&gt;
[[es:FAQ_Recuperar,_actualizar_GIT_fuentes_del_proyecto]]&lt;br /&gt;
&amp;lt;!-- END interlang links --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ FR]]&lt;br /&gt;
{{TemplateDocDevFr}}&lt;br /&gt;
Voici les informations sur comment récuperer et travailler avec les sources du projet Dolibarr.&lt;br /&gt;
&lt;br /&gt;
=Recevoir la dernière version des sources par téléchargement=&lt;br /&gt;
Cette méthode vous permet de recevoir les sources de la branche de développement principale (Appelée HEAD). Cette opération consiste à récupérer la dernière version des fichiers de l&#039;application Dolibarr qui sont compilées chaque nuit dans un fichier tgz. Ce fichier est disponible par le lien suivant:&lt;br /&gt;
&lt;br /&gt;
{{LinkLastSnapshot}}&lt;br /&gt;
&lt;br /&gt;
Les nouveaux fichiers écrasent les anciens. Le problème de cette méthode est qu&#039;il faut télécharger et décompresser chaque fois le paquet dès que l&#039;on souhaite recevoir des mises à jour.&lt;br /&gt;
&lt;br /&gt;
=Recevoir la dernière version des sources en utilisant un accès anonyme GIT.=&lt;br /&gt;
==Prérequis==&lt;br /&gt;
&lt;br /&gt;
*Avec l&#039;IDE Eclipse&lt;br /&gt;
&lt;br /&gt;
Premièrement, vous devez avoir une installation fonctionnelle de Eclipse. Le plugin &#039;&#039;&#039;EGit&#039;&#039;&#039; doit aussi être installé.&lt;br /&gt;
Pour l&#039;installer, utilisez &#039;&#039;&#039;Help&#039;&#039;&#039; depuis le menu Eclipse puis cliquez sur &#039;&#039;&#039;Install new software&#039;&#039;&#039;et cliquez sur &#039;&#039;&#039;Available software site&#039;&#039;&#039;. Dans la liste des adresses qui apparait, recherchez le lien :&lt;br /&gt;
 http://download.eclipse.org/egit/updates&lt;br /&gt;
Puis, choisissez d&#039;installer &#039;&#039;&#039;EGit&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
*Avec le client GIT en ligne de commande&lt;br /&gt;
&lt;br /&gt;
Pour récuperer les sources dans l&#039;intention de les modifier, vous avez besoin d&#039;un compte GitHub, et un client GIT (Les outils GIT en ligne de commande Linux, ou le client GIT d&#039;Eclipse).&lt;br /&gt;
&lt;br /&gt;
==Processus de Clone==&lt;br /&gt;
{{ToTranslate}}&lt;br /&gt;
First, enter value of the repository with reference sources into your GIT client tool.&lt;br /&gt;
&lt;br /&gt;
*Avec l&#039;IDE Eclipse, choose &amp;quot;Clone GIT repository&amp;quot;. Enter GIT URL of project to get.&lt;br /&gt;
&lt;br /&gt;
GIT Url for Dolibarr official source is:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
git@github.com:Dolibarr/dolibarr.git&lt;br /&gt;
or&lt;br /&gt;
git://github.com/Dolibarr/dolibarr.git (lecture seule)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Your Eclipse GIT client will ask you to choose the branches you are interesting in. Branches not selected now could be selected later by doing a &amp;quot;Fetch&amp;quot; from the &amp;quot;Remotes&amp;quot; view, but try to choose only the branch you need. This will save you time and problems later.&lt;br /&gt;
&lt;br /&gt;
*Avec le client GIT en ligne de commande:&lt;br /&gt;
&lt;br /&gt;
First setup your git client:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git config --global user.name &amp;quot;Your Name&amp;quot;&lt;br /&gt;
git config --global user.email &amp;quot;user@domain.com&amp;quot;&lt;br /&gt;
git config --list&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Then clone repository locally:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone git://github.com/Dolibarr/dolibarr.git dolibarr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
And, if you are behind a firewall, you can user the alternate URL:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git config --global http.proxy http://proxyuser:proxypass@proxyserver:proxyport&lt;br /&gt;
git clone https://gitlogin:gitpassword@github.com/Dolibarr/dolibarr.git dolibarr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this step is validated, your GIT client will download all files from remote GIT server. This may last several seconds or minutes.&lt;br /&gt;
&lt;br /&gt;
Once download is finished, go into GIT view - Branches - Local. In most cases, the branch you choosed should be already available.&lt;br /&gt;
&lt;br /&gt;
If not:&lt;br /&gt;
&lt;br /&gt;
*Avec Eclipse, right click on &amp;quot;Branches - Remotes - The branch you want to duplicate locally&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If you choose &amp;quot;Create Branch&amp;quot;, this will duplicate content of branch to work on it locally.&lt;br /&gt;
If you Choose &amp;quot;Checkout&amp;quot;, this will update the view &amp;quot;Working Directory&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
*With GIT on Command Line Interface&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git checkout develop&lt;br /&gt;
git checkout x.y&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This will create local branch and make checkout automatically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If using Eclipse, once your branch is created locally, create a PHP project from assistant by choosing &amp;quot;&#039;&#039;&#039;Create from existing project&#039;&#039;&#039;&amp;quot; and select directory that is your GIT local repository (Do not choose to create a PHP project from scratch).&lt;br /&gt;
Then right click on project from your Eclipse workspace and Choose &amp;quot;&#039;&#039;&#039;Team - Share&#039;&#039;&#039;&amp;quot;. Select GIT and click on option &amp;quot;&#039;&#039;&#039;Use or create repository in parent folder of project&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
An alternate method is File-&amp;gt;Import, Git-&amp;gt;Project from Git, Select the Git repository and Next, Use New project Wizard -&amp;gt; Php project, enter the folder of you GIT local repository.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, you can setup Eclipse to avoid it to scan all project files for its build tools (Outline scanner, TODO scanner, syntax scanner...). This will avoid Eclipse to be too slow. For this, right click on project, choose Build Path and setup it like into following screenshot.&lt;br /&gt;
&lt;br /&gt;
[[File:Eclipse php build path.png|240px]]&lt;br /&gt;
&lt;br /&gt;
=Récupérer la dernière version des sources avec un accès GIT complet=&lt;br /&gt;
==Prérequis==&lt;br /&gt;
First you must have a working install of Eclipse. &#039;&#039;&#039;EGit&#039;&#039;&#039; plugin must also have been installed.&lt;br /&gt;
For this, use the &#039;&#039;&#039;Find And Install process&#039;&#039;&#039; into Eclipse menu, add the GIT update URL: &lt;br /&gt;
 http://download.eclipse.org/egit/updates&lt;br /&gt;
Then choose to install &#039;&#039;&#039;EGit&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
You must before create an account on GitHub (https://github.com/) and upload a public RSA or DSA certificate into your account profile.&lt;br /&gt;
&lt;br /&gt;
==Processus de clone==&lt;br /&gt;
Le processus est le même que pour récupérer les sources de manière anonyme (voir ci-dessus), seule l&#039;URL d&#039;accès change.&lt;br /&gt;
&lt;br /&gt;
URL à utiliser pour le clonage GIT:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
git@github.com:Dolibarr/dolibarr.git&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Noter que une URL HTTP est aussi disponible mais est parfois hors service (aussi prenez de préférence la méthode précédente):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
https://yourgitlogin@github.com/Dolibarr/dolibarr.git&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Mettre à jour votre repository=&lt;br /&gt;
To update your local workspace, right click on Eclipse project and select &amp;quot;Pull&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If you made some changes into your Eclipse workspace on files that were changed into the GIT remote reference, your GIT client will make a merge automatically.&lt;br /&gt;
&lt;br /&gt;
*If there is conflicts, the merge will mark all conflict files as &amp;quot;conflict&amp;quot; (See later to solve this state).&lt;br /&gt;
*If not, you will get all new version files including all your changes.&lt;br /&gt;
&lt;br /&gt;
If you already have commited some files into your local repository, your workspace will be marked as &amp;quot;Merged&amp;quot;.&lt;br /&gt;
All you have to do is make a commit to validate your local repository as including your changes and changes made by others.&lt;br /&gt;
&lt;br /&gt;
=Validez et publiez vos modifications=&lt;br /&gt;
To see all changes you made into your working directory and waiting to be added into Git:&lt;br /&gt;
&lt;br /&gt;
*With GIT Command Line Interface:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git status&lt;br /&gt;
git diff subdir/filename&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To add changes made into your local repository into the GIT index, then commit this index :&lt;br /&gt;
&lt;br /&gt;
*With Eclipse: Right click on file or directory to commit. Select file to add/remove/update into commit.&lt;br /&gt;
*With GIT Command Line Interface:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git commit -a -m &amp;quot;Commit text&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This will save add and changes into your local branch.&lt;br /&gt;
&lt;br /&gt;
To push them on the GIT repository server,&lt;br /&gt;
&lt;br /&gt;
*With Eclipse: right click on project and choose &amp;quot;&#039;&#039;&#039;Team - Push to Upstream&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
*With GIT Command Line Interface:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git push&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To cancel a commit:&lt;br /&gt;
&lt;br /&gt;
*With GIT Command Line Interface:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git revert IdCommit  or  git revert HEAD  (for last commit)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Ajout un commit exterieur dans votre repository courant=&lt;br /&gt;
Some developers may work and do commit into their own Git repository after forking the project. If you are interesting into getting this changes, you can import them with the following steps with Eclipse:&lt;br /&gt;
&lt;br /&gt;
*First, go into GIT setup view and right click on &amp;quot;&#039;&#039;&#039;Remotes&#039;&#039;&#039;&amp;quot; of your Eclipse Git working space and choose &amp;quot;&#039;&#039;&#039;Create a remote...&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
*Type name or remote fork the developer has create (in most cases, it&#039;s developer Git login). For example: &amp;quot;&#039;&#039;&#039;thedevlogin&#039;&#039;&#039;&amp;quot;. Choose also &amp;quot;&#039;&#039;&#039;Configure Fetch&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
*Type URI of Git repository of developer. For example: &#039;&#039;&#039;git://github.com/thedevlogin/dolibarr.git&#039;&#039;&#039;. Also add a refspec value to declare the branch you want to get. For example: &#039;&#039;&#039;refs/heads/master:refs/remotes/thedevlogin/master&#039;&#039;&#039;. Click &amp;quot;&#039;&#039;&#039;Save and Fetch&#039;&#039;&#039;&amp;quot;. A new entry will be added into &amp;quot;Remote Tracking&amp;quot; making possible to read/get commits done into this branch.&lt;br /&gt;
&lt;br /&gt;
Now, go on command line of your git repository (in most cases on Linux, it&#039;s &#039;&#039;&#039;/home/yourlogin/git/yourdolibarr&#039;&#039;&#039;) and type the git cherry-pick command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git cherry-pick -x commitid&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
where commitid is value of commit id you want to get.&lt;br /&gt;
&lt;br /&gt;
Once this is done, go back to Eclipse and make a refresh on project. You will see modified files appears with decorators (with conflicts if there is).&lt;br /&gt;
&lt;br /&gt;
It the cherry-pick fails because of conflicts, you can cancel the cherry-pick try with&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git cherry-pick --abort&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Résoudre un conflit=&lt;br /&gt;
Si un fichier est marqué en &amp;quot;Conflit&amp;quot; après un &amp;quot;Pull&amp;quot;, ouvrez le fichier et éditez le.&lt;br /&gt;
Rechercher la chaine &amp;quot;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;quot;, vous verrez la partie de code en conflit entre &amp;quot;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;quot; et &amp;quot;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;quot;. Editer manuellement les lignes de codes pour avoir le résultat finale en supprimant également les &amp;quot;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;quot; et &amp;quot;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Ensuite, faire un click droit sur le fichier puis choisir &amp;quot;Add&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If you prefer to forget completely all changes you made into all files (so to restore you workspace with content of remote repository), you can make a hard reset:&lt;br /&gt;
&lt;br /&gt;
*With Eclipse, right click on project top line and select &amp;quot;&#039;&#039;&#039;Reset&#039;&#039;&#039;&amp;quot; then &amp;quot;&#039;&#039;&#039;Hard&#039;&#039;&#039;&amp;quot; then &amp;quot;&#039;&#039;&#039;Reference - HEAD&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
*Using GIT command line tool, you can achieve this with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git reset --hard HEAD &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Tagguer les sources=&lt;br /&gt;
Avec les outils en Ligne de Commande GIT:&lt;br /&gt;
&lt;br /&gt;
Pour créer un tag sur une version:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git tag -a -m &amp;quot;Release|Maintenance release x.y.z&amp;quot; &amp;quot;x.y.z&amp;quot;&lt;br /&gt;
or&lt;br /&gt;
git tag -a -f -m &amp;quot;Beta x.y.betai&amp;quot; &amp;quot;x.y.betai_YYYYMMDD&amp;quot; idcommit   # -f force si un tag existe déjà, idcommit permet de choisir le commit à tagguer&lt;br /&gt;
&lt;br /&gt;
git push --tags   # Pour pousser le tags sur le serveur distant&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pour supprimer un tag:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git tag -d &amp;quot;x.y.z_YYYYMMDD&amp;quot;&lt;br /&gt;
git push origin :x.y.z_YYYYMMDD    # Pour valider la suppression sur le serveur distant&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Créer une nouvelle branche=&lt;br /&gt;
Voici la commande à utiliser pour créer une nouvelle branche depuis un repository propre develop:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git branch x.y&lt;br /&gt;
git push origin x.y&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Statistiques=&lt;br /&gt;
Avec les outils en Ligne de Commande GIT:&lt;br /&gt;
&lt;br /&gt;
Pour compter le nombre de changerment qu&#039;un développeur a fait entre une version x et y:&lt;br /&gt;
&lt;br /&gt;
*First, run git merge-base to know the id of last common commit between x and y&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git merge-base origin/3.1 origin/develop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Then run git log to have list of all changes from last common commit to last commit&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git log id_found_at_previous_step..HEAD&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*To get total number of added/deleted lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git log --ancestry-path --numstat --pretty=&amp;quot;%H&amp;quot; id_found_at_previous_step..HEAD | awk &#039;NF==3 {plus+=$1; minus+=$2} END {printf(&amp;quot;+%d, -%d\n&amp;quot;, plus, minus)}&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To count number of changes finally between a version x and y (it differs from previous count because in previous count, a change can be done 2 times at two different moment to change differently. With second method, you count change finally found if changes were ok at first try):&lt;br /&gt;
&lt;br /&gt;
*Use same method than previously but instead of running git log, run git diff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git diff -b -M --numstat --pretty=&amp;quot;%H&amp;quot; id_found_at_previous_step..HEAD | awk &#039;NF==3 {plus+=$1; minus+=$2} END {printf(&amp;quot;+%d, -%d\n&amp;quot;, plus, minus)}&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plus d&#039;information sur l&#039;utilisation de GIT disponible [http://wiki.eclipse.org/EGit/User_Guide ici].&lt;/div&gt;</summary>
		<author><name>Alexis BERNARD</name></author>
	</entry>
</feed>