<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
		<id>https://wiki.kogite.fr/index.php?action=history&amp;feed=atom&amp;title=Git_%3A_d%C3%83%C2%A9ploiement_avec_git</id>
		<title>Git : dÃ©ploiement avec git - Historique des versions</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.kogite.fr/index.php?action=history&amp;feed=atom&amp;title=Git_%3A_d%C3%83%C2%A9ploiement_avec_git"/>
		<link rel="alternate" type="text/html" href="https://wiki.kogite.fr/index.php?title=Git_:_d%C3%83%C2%A9ploiement_avec_git&amp;action=history"/>
		<updated>2026-06-21T18:49:43Z</updated>
		<subtitle>Historique des versions pour cette page sur le wiki</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https://wiki.kogite.fr/index.php?title=Git_:_d%C3%83%C2%A9ploiement_avec_git&amp;diff=6101&amp;oldid=prev</id>
		<title>Frank le 28 novembre 2014 à 13:33</title>
		<link rel="alternate" type="text/html" href="https://wiki.kogite.fr/index.php?title=Git_:_d%C3%83%C2%A9ploiement_avec_git&amp;diff=6101&amp;oldid=prev"/>
				<updated>2014-11-28T13:33:20Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;fr&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Version précédente&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Version du 28 novembre 2014 à 13:33&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l96&quot; &gt;Ligne 96 :&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Ligne 96 :&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; git push origin&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; git push origin&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;test&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Frank</name></author>	</entry>

	<entry>
		<id>https://wiki.kogite.fr/index.php?title=Git_:_d%C3%83%C2%A9ploiement_avec_git&amp;diff=6100&amp;oldid=prev</id>
		<title>Frank le 28 novembre 2014 à 13:32</title>
		<link rel="alternate" type="text/html" href="https://wiki.kogite.fr/index.php?title=Git_:_d%C3%83%C2%A9ploiement_avec_git&amp;diff=6100&amp;oldid=prev"/>
				<updated>2014-11-28T13:32:57Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;fr&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Version précédente&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Version du 28 novembre 2014 à 13:32&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l96&quot; &gt;Ligne 96 :&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Ligne 96 :&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; git push origin&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; git push origin&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;test&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Frank</name></author>	</entry>

	<entry>
		<id>https://wiki.kogite.fr/index.php?title=Git_:_d%C3%83%C2%A9ploiement_avec_git&amp;diff=6092&amp;oldid=prev</id>
		<title>Frank : Page créée avec « Le déploiement automatique d'une application avec GIT s'effectue en 3 temps : # création/modification de fichiers sur le(s) poste(s) de travail # push vers le serveur GI... »</title>
		<link rel="alternate" type="text/html" href="https://wiki.kogite.fr/index.php?title=Git_:_d%C3%83%C2%A9ploiement_avec_git&amp;diff=6092&amp;oldid=prev"/>
				<updated>2014-11-28T11:50:20Z</updated>
		
		<summary type="html">&lt;p&gt;Page créée avec « Le déploiement automatique d&amp;#039;une application avec GIT s&amp;#039;effectue en 3 temps : # création/modification de fichiers sur le(s) poste(s) de travail # push vers le serveur GI... »&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Le déploiement automatique d'une application avec GIT s'effectue en 3 temps :&lt;br /&gt;
# création/modification de fichiers sur le(s) poste(s) de travail&lt;br /&gt;
# push vers le serveur GIT&lt;br /&gt;
# déploiement par le serveur GIT vers la destination définitive du logiciel (répertoire local du même serveur, ou '''serveur distant''')&lt;br /&gt;
&lt;br /&gt;
Le dépôt GIT (point 2) n'est pas lisible en tant que tel, les fichiers sont renommés par GIT et classés pour gérer l'historique des versions. C'est pourquoi on ne peut pas directement utiliser ce dépôt comme répertoire définitif pour l'application. Le dépôt GIT doit être vu comme un serveur de versions, rien d'autre.&lt;br /&gt;
&lt;br /&gt;
== Sur le serveur GIT ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
 apt-get install git&lt;br /&gt;
ou&lt;br /&gt;
 yum install git&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
 mkdir /home/gittest&lt;br /&gt;
 cd /home/gittest&lt;br /&gt;
 git init --bare&lt;br /&gt;
   Initialized empty Git repository in /home/gittest/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
== Sur le premier poste de travail ==&lt;br /&gt;
premier push, qui initialise la branche &amp;quot;master&amp;quot; :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
 cd /Develop/gittest&lt;br /&gt;
 git init&lt;br /&gt;
   Initialized empty Git repository in /Develop/gittest/.git/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Création d'un premier fichier :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
 echo &amp;quot;version 0.1&amp;quot; &amp;gt; README&lt;br /&gt;
 git add .&lt;br /&gt;
 git commit -m &amp;quot;Premier commit&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Ajout du dépôt GIT (ici, on passe par le protocol SSH car c'est le seul ouvert sur le firewall. ça évite d'ouvrir un port spécifique GIT) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
 git remote add origin ssh://usergit@serveurgit.systea.fr/home/gittest&lt;br /&gt;
 git push origin master #(&amp;quot;master&amp;quot; important la 1ere fois pour créer la branche sur le serveur; ensuite on peut se contenter de &amp;quot;push origin&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Réponse si git non initialisé sur serveur :&lt;br /&gt;
   fatal: '/home/gittest' does not appear to be a git repository&lt;br /&gt;
   fatal: The remote end hung up unexpectedly&amp;quot;&lt;br /&gt;
Si initialisé :&lt;br /&gt;
   Counting objects: 3, done.&lt;br /&gt;
   Writing objects: 100% (3/3), 210 bytes, done.&lt;br /&gt;
   Total 3 (delta 0), reused 0 (delta 0)&lt;br /&gt;
   To ssh://usergit@serveurgit.systea.fr/home/gittest&lt;br /&gt;
    * [new branch]      master -&amp;gt; master&lt;br /&gt;
&lt;br /&gt;
== Déploiement ==&lt;br /&gt;
Dans cet exemple, on déploie l'application sur le même serveur que le dépôt git. On déploie (clone du dépôt) dans le répertoire web &amp;quot;Production&amp;quot; :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
 cd /var/www&lt;br /&gt;
 git clone /home/gittest Production&lt;br /&gt;
   Cloning into Production...&lt;br /&gt;
   done.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Automatisation de la mise en prod : on créé le script postupdate du dépôt GIT qui &amp;quot;pull&amp;quot; (pousse) les modifications qui arrivent vers le répertoire de l'application :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
 cd /home/gittest/hooks&lt;br /&gt;
 vi post-update&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
   #!/bin/bash&lt;br /&gt;
   echo &amp;quot;********** mise en production *********&amp;quot;&lt;br /&gt;
   cd /var/www/Production&lt;br /&gt;
   unset GIT_DIR&lt;br /&gt;
   git pull origin master&lt;br /&gt;
 chmod +x post-update&lt;br /&gt;
&lt;br /&gt;
Test : sur le poste de travail créer un autre fichier monscript, puis :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
 git add . # &amp;quot;add&amp;quot; nécessaire pour intégrer les nouveaux fichiers uniquement&lt;br /&gt;
 git commit -m &amp;quot;Second commit&amp;quot;&lt;br /&gt;
 git log&lt;br /&gt;
 git push origin&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Sur le serveur :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
 ls -l /var/www/Production/&lt;br /&gt;
   -rw-r--r-- 1 root root 19 Jun  5 09:26 README&lt;br /&gt;
   -rwxr-xr-x 1 root root 33 Jun  5 09:37 monscript&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
TODO : procédure si le serveur de production est distant&lt;br /&gt;
&lt;br /&gt;
== Autres postes de travail ==&lt;br /&gt;
Pour travailler à partir d'un autre poste :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
 cd /répertoire_de_dév/&lt;br /&gt;
 git clone usergit@serveurgit.systea.fr/home/gittest&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
(l'ajout du dépôt (&amp;quot;git remote add origin ...&amp;quot;) n'est pas nécessaire ici, le &amp;quot;clone&amp;quot; se charge de tout.&lt;br /&gt;
&lt;br /&gt;
A partir de tous les postes, l'envoi d'une modification se fera ensuite toujours par :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
 cd gittest&lt;br /&gt;
 vi monscript.sh # modifier le fichier&lt;br /&gt;
 git commit -a -m &amp;quot;commit poste2&amp;quot;&lt;br /&gt;
 git push origin&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Frank</name></author>	</entry>

	</feed>