<p style="text-align:center;"><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><img alt="
[email protected]" src="https://git-scm.com/images/
[email protected]"/></span></span></p>
<p style="text-align:center;"><span style="font-size:14px;"><span style="font-size:24px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>Débuter avec Git</strong></span></span></span></p>
<p style="text-align:center;"><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><em>Ce tutoriel va vous aider à maîtriser Git, un célèbre logiciel de gestion de version, pour gérer au mieux vos projets.</em></span></span></p>
<p style="text-align:center;"> </p>
<p> </p>
<p style="margin-left:40px;"><span style="color:#b22222;"><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><span style="font-size:18px;"><strong>1. Git qu’est-ce que c’est ?</strong></span></span></span></span></p>
<p> </p>
<p><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>Git est logiciel de gestion de version décentralisé</strong> créé par Linus Torvalds, créateur du noyau Linux, lancé en 2005. Autrement dit, c’est un logiciel qui vous permettra de <strong>gérer les modifications apportées à un répertoire de travail</strong>. Ainsi, <strong>la gestion de votre projet sera considérablement améliorer</strong> et vos collaborateurs pourront travailler sereinement dessus sans avoir à se communiquer le code source avec un <strong>suivit complet de l’évolution du code source</strong> à travers une suite d’outils très intéressante pour vous permettre une gestion optimisée votre dépôt et une parfaite harmonie entre les différents commit réalisés par votre équipe :</span></span></p>
<ul><li><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>Commit</strong> : Regroupe une liste de modifications apportées au répertoire ainsi que des informations données par l’auteur.</span></span>
</li><li><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>Diff</strong> : Permet de connaître les différences entre deux commits.</span></span></li>
<li><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>Branch</strong> : Permet de dériver vos branches (autrement dit, ce seront des versions de votre projet).</span></span></li>
<li><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>Pull</strong> : Permet de récupérer un répertoire depuis un dépôt (plusieurs options de fusion s’offrent à vous).</span></span></li>
<li><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>Push</strong> : Permet de pousser un répertoire vers un dépôt.</span></span></li>
<li><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>Patch</strong> : Permet de créer et d’appliquer des patchs sur votre répertoire (Les patchs se génèrent à partir d’un commit).</span></span></li>
</ul><p></p><p style="margin-left:40px;"><span style="color:#b22222;"><span style="font-size:18px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>2. Utilisation de Git</strong></span></span></span></p>
<p style="margin-left:80px;"><span style="color:#008000;"><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><span style="font-size:18px;"><strong>2.1 En ligne de commande</strong></span></span></span></span></p>
<p> </p>
<p><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;">Son utilisation est plus ou moins complexe puisque ce logiciel est conçu pour être utilisé en <strong>ligne de commandes</strong>. Il vous faut donc absolument connaître cette liste de commandes ci-dessous :</span></span></p>
<ul><li><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>git init</strong> : Créé un répertoire de travail.</span></span>
</li><li><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>git clone <depot></strong> : Clone un dépôt dans votre répertoire de travail.</span></span></li>
<li><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>git add <fichier></strong> : Ajoute un fichier au dépôt.</span></span></li>
<li><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>git commit -a</strong> : Commit tous les fichiers.</span></span></li>
<li><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>git commit <fichier></strong> : Commit le fichier.</span></span></li>
<li><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>git pull origin</strong> : Récupère le code source depuis le dépôt cloné.</span></span></li>
<li><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>git push origin</strong> : Pousse votre code source vers un dépôt cloné.</span></span></li>
<li><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>git branch <</strong><strong>branche</strong><strong>></strong> : Créé une branche.</span></span></li>
<li><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>git branch –d <</strong><strong>branche</strong><strong>></strong> : Supprime une branche</span></span></li>
<li><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>git checkout <fichier></strong> : Annule les modifications apportées à un fichier.</span></span></li>
<li><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>git reset --hard</strong> : Annule toutes les modifications apportées à un répertoire.</span></span></li>
<li><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>Git diff <fichier> <fichier></strong> : Affiche les différences entre deux fichiers.</span></span></li>
</ul><p> </p>
<p style="margin-left:80px;"><span style="color:#008000;"><span style="font-size:18px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>2.2 Avec une interface graphique</strong></span></span></span></p>
<p> </p>
<p><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;">Heureusement, <strong>des développeurs ont créé des logiciels clients permettant d’obtenir une interface graphique du produit</strong> en interprétant les données de configuration stockées par Git dans votre répertoire de travail. Sur le <a data-ipb="nomediaparse" href="http://git-scm.com/" rel="external nofollow">site officiel de Git</a>, vous pourrez trouver une large gamme de clients graphiques.</span></span></p>
<p style="text-align:center;"><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><a href="http://www.hostingpics.net/viewer.php?id=495471gitextensiontutogit.png" rel="external nofollow"><img alt="495471gitextensiontutogit.png" src="<base_url>/applications/sslimageproxy/interface/image.php?url=http://img11.hostingpics.net/pics/495471gitextensiontutogit.png"/></a></span></span></p>
<p style="text-align:center;"><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><em>Git Extensions, un client GUI de Git. </em></span></span></p>
<p style="text-align:center;"> </p>
<p><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>Trois commandes à ne pas oublier :</strong></span></span></p>
<ul><li><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>Commiter :</strong> Commentez et ajoutez votre travail à votre répertoire.</span></span>
</li></ul><p><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><a href="http://www.hostingpics.net/viewer.php?id=480458commitgit.jpg" rel="external nofollow"><img alt="480458commitgit.jpg" src="<base_url>/applications/sslimageproxy/interface/image.php?url=http://img15.hostingpics.net/pics/480458commitgit.jpg"/></a></span></span></p>
<ul><li><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>Pousser : </strong>Envoyez votre travail sur un répertoire distant.</span></span>
</li></ul><p><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><a href="http://www.hostingpics.net/viewer.php?id=156315pushgit.jpg" rel="external nofollow"><img alt="156315pushgit.jpg" src="<base_url>/applications/sslimageproxy/interface/image.php?url=http://img15.hostingpics.net/pics/156315pushgit.jpg"/></a></span></span></p>
<ul><li><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>Récupérer :</strong> Récupérer un travail depuis un dépôt comme Github.</span></span>
</li></ul><p><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><a href="http://www.hostingpics.net/viewer.php?id=272430pullgit.jpg" rel="external nofollow"><img alt="272430pullgit.jpg" src="http://img15.hostingpics.net/pics/272430pullgit.jpg"/></a></span></span></p>
<p></p><p style="margin-left:40px;"><span style="color:#b22222;"><span style="font-size:18px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>3. GitHub : Partagez vos projets en ligne</strong></span></span></span></p>
<p> </p>
<p><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;">Avec <a data-ipb="nomediaparse" href="https://github.com/" rel="external nofollow">GitHub</a>, <strong>vous pourrez partager vos projets avec vos collaborateurs</strong>. En effet, ce site va stocker vos projets en ligne et vous pourrez les gérer depuis ce site. Tout comme un client graphique Git, vous pourrez suivre l’avancée de vos projets avec les commits et vos différentes branches. En outre, ce site vous propose un <strong>bugtracker</strong> (dans l’onglet « Issues ») et un <strong>rebasage de votre branche sur d’autres créées par des contributeurs</strong> de votre projet (dans l’onglet « Pull Requests »). Vous avez aussi la possibilité de créer un <strong>« wiki »</strong> contenant une liste d’informations utiles pour votre projet. Néanmoins, si vous ne voulez pas que vos projets soit rendus public, vous avez la <strong>possibilité de les privatiser</strong>, malheureusement ce service est payant.</span></span></p>
<p> </p>
<ul><li><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>Créer un répertoire :</strong></span></span>
</li></ul><p><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;">Sur la page d’accueil de GitHub, à droite, vous avez la liste de vos répertoires et un bouton <strong>« New repository »</strong>.</span></span></p>
<p><a href="http://www.hostingpics.net/viewer.php?id=655332newrepo.jpg" rel="external nofollow"><img alt="655332newrepo.jpg" src="http://img15.hostingpics.net/pics/655332newrepo.jpg"/></a></p>
<p> </p>
<ul><li><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>Découverte du dépôt :</strong></span></span>
</li></ul><p><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><a href="http://www.hostingpics.net/viewer.php?id=615461repo.jpg" rel="external nofollow"><img alt="615461repo.jpg" src="<base_url>/applications/sslimageproxy/interface/image.php?url=http://img15.hostingpics.net/pics/615461repo.jpg"/></a></span></span></p>
<p> </p>
<p><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>Branch : </strong>Les branches sont des dérivées de votre code. Par exemple, vous pouvez créer une branche master contenant une version stable de votre projet et une version de développement où vous développerez votre projet.</span></span></p>
<p> </p>
<p><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>Issues :</strong> C’est un bugtracker. Tout contributeur peut rapporter un bug. Vous pouvez fixer des objectifs (réparer x bugs en x jours), assignez un bug à un contributeur, ajouter des labels ou encore commentez l’avancement d’un bug.</span></span></p>
<p><a href="http://www.hostingpics.net/viewer.php?id=974458githubissuses.jpg" rel="external nofollow"><img alt="974458githubissuses.jpg" src="<base_url>/applications/sslimageproxy/interface/image.php?url=http://img15.hostingpics.net/pics/974458githubissuses.jpg"/></a></p>
<p> </p>
<p><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>Pull Requests :</strong> Cet outil permet aux contributeurs de votre projet de vous proposer des corrections sur celui-ci. Les contributeurs doivent avoir une copie modifiée de votre répertoire de travail dans leur dépôt Github.</span></span></p>
<p><a href="http://www.hostingpics.net/viewer.php?id=922794githubpullrequest.jpg" rel="external nofollow"><img alt="922794githubpullrequest.jpg" src="<base_url>/applications/sslimageproxy/interface/image.php?url=http://img15.hostingpics.net/pics/922794githubpullrequest.jpg"/></a></p>
<p> </p>
<p><span style="font-size:14px;"><span style="font-family:'lucida sans unicode', 'lucida grande', sans-serif;"><strong>Wiki :</strong> Une petite documentation pour votre projet ? Ça ne fait pas de mal.</span></span></p>