Resources attached to the Road To DevOps tutorial
https://blog.noobtoroot.xyz/road-to-devops/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
149 lines
8.6 KiB
149 lines
8.6 KiB
2 years ago
|
<!-- .slide: data-background="#2E2E2E" data-state="nologo-slide" -->
|
||
|
# Bonnes pratiques
|
||
|
|
||
|
@@
|
||
|
<div class="sl-block" data-block-type="text" style="height: auto; width: 960px; left: 0px; top: 2px;" data-block-id="6e848bcd106a09624beaf277e02de1f0">
|
||
|
<div class="sl-block-content" data-placeholder-tag="p" data-placeholder-text="Text" style="z-index: 10;">
|
||
|
<h2>Reflog</h2>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="sl-block" data-block-type="text" style="height: auto; width: 840px; left: 80px; top: 132px;" data-block-id="fc8cf04d40475e8cca5ff6513838447f">
|
||
|
<div class="sl-block-content" data-placeholder-tag="p" data-placeholder-text="Text" style="z-index: 11;" dir="ui">
|
||
|
<p style="text-align:left">Bouée de secours.</p>
|
||
|
<p style="text-align:left"> </p>
|
||
|
<p style="text-align:left">Historise tous les changements.</p>
|
||
|
<p style="text-align:left"> </p>
|
||
|
<p style="text-align:left">Permet de retrouver des commits supprimés !</p>
|
||
|
<p style="text-align:left"> </p>
|
||
|
<p>
|
||
|
<pre><code>$ git reflog</code></pre>
|
||
|
</p>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
@@
|
||
|
<div class="sl-block" data-block-type="text" style="height: auto; width: 960px; left: 0px; top: 2px;" data-block-id="ca5ecd5bf8104c3dcb1f07937e60a05e">
|
||
|
<div class="sl-block-content" data-placeholder-tag="p" data-placeholder-text="Text" style="z-index: 10;">
|
||
|
<h2>Stash</h2>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="sl-block" data-block-type="text" style="height: auto; width: 900px;top: 132px;" data-block-id="f0cc17f668368acec58c7753c6623cb7">
|
||
|
<div class="sl-block-content" data-placeholder-tag="p" data-placeholder-text="Text" style="z-index: 11;" dir="ui">
|
||
|
<p style="text-align:left">Sauvegarde les modifications non indexées sur une étagère</p>
|
||
|
<p style="text-align:left"> </p>
|
||
|
<p style="text-align:left">Utile pour récupérer des commits distants sans commit les modifications locales</p>
|
||
|
<p style="text-align:left"> </p>
|
||
|
<p style="text-align:left">
|
||
|
<code>$ git stash <nom_stash></code> (création)
|
||
|
</p>
|
||
|
<p style="text-align:left">
|
||
|
<code>$ git stash pop <nom stash></code>(supprime et applique)
|
||
|
</p>
|
||
|
<p style="text-align:left">
|
||
|
<code>$ git stash apply <nom stash></code>(applique le stash)
|
||
|
</p>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
@@
|
||
|
<div class="sl-block" data-block-type="text" style="height: auto; width: 960px; left: 0px; top: 2px;" data-block-id="055aaa5adaae89329085ba38ce407bff">
|
||
|
<div class="sl-block-content" data-placeholder-tag="p" data-placeholder-text="Text" style="z-index: 10;">
|
||
|
<h2>Revert</h2>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="sl-block" data-block-type="text" style="height: auto; width: 800px; left: 80px; top: 133px;" data-block-id="47f2871e1530639a62d74705353ca7c7">
|
||
|
<div class="sl-block-content" data-placeholder-tag="p" data-placeholder-text="Text" style="z-index: 11;" dir="ui">
|
||
|
<p style="text-align:left">Annule un commit.</p>
|
||
|
<p style="text-align:left"> </p>
|
||
|
<p style="text-align:left">Un nouveau commit est créé pour restaurer l'état des fichiers.</p>
|
||
|
<p style="text-align:left"> </p>
|
||
|
<p style="text-align:left">Unique solution de retour arrière lorsque le commit a été envoyé sur le serveur distant. </p>
|
||
|
<p style="text-align:left"> </p>
|
||
|
<p style="text-align:left">
|
||
|
<code>$ git revert <sha></code>
|
||
|
</p>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
@@
|
||
|
<div class="sl-block" data-block-type="text" style="height: auto; width: 960px; left: 0px; top: 2px;" data-block-id="aa45a652c6cc90d72de7f0e0905cadad">
|
||
|
<div class="sl-block-content" data-placeholder-tag="p" data-placeholder-text="Text" style="z-index: 10;">
|
||
|
<h2>Bisect</h2>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="sl-block" data-block-type="text" style="height: auto; width: 800px; left: 80px; top: 133px;" data-block-id="2ef706b8f8885101ccdd1032bce52d91">
|
||
|
<div class="sl-block-content" data-placeholder-tag="p" data-placeholder-text="Text" style="z-index: 11;" dir="ui">
|
||
|
<p style="text-align:left">Compare des commits entre eux.</p>
|
||
|
<p style="text-align:left"> </p>
|
||
|
<p style="text-align:left">A partir d'une référence.</p>
|
||
|
<p style="text-align:left"> </p>
|
||
|
<p style="text-align:left">Très utile pour rechercher une anomalie dans le code.</p>
|
||
|
<p style="text-align:left"> </p>
|
||
|
<p style="text-align:left">
|
||
|
<code>$ git bisect start</code>
|
||
|
</p>
|
||
|
<p style="text-align:left">
|
||
|
<code>$ git bisect bad</code>
|
||
|
</p>
|
||
|
<p style="text-align:left">
|
||
|
<code>$ git bisect good <sha></code>
|
||
|
</p>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
@@
|
||
|
<div class="sl-block" data-block-type="text" style="height: auto; width: 960px; left: 0px; top: 2px;" data-block-id="77283fc05adabc3adc3328ae8281db01">
|
||
|
<div class="sl-block-content" data-placeholder-tag="p" data-placeholder-text="Text" style="z-index: 12;">
|
||
|
<h2>Gestion des conflits</h2>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="sl-block" data-block-type="text" style="height: auto; width: 380px; left: 560px; top: 370px;" data-block-id="708f0ee0e419599cb53424db45ab4be9">
|
||
|
<div class="sl-block-content" data-placeholder-tag="p" data-placeholder-text="Text" style="z-index: 13;" dir="ui">
|
||
|
<p>Changements locaux</p>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="sl-block" data-block-type="image" style="min-width: 4px; min-height: 4px; width: 800px; height: 199px; left: 80px; top: 118px;" data-block-id="bc098524fae7d038cc914d010ca0792c">
|
||
|
<div class="sl-block-content" style="z-index: 14;">
|
||
|
<img data-natural-width="181" data-natural-height="45" style="" src="svg/conflict.svg" data-lazy-loaded=""/>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="sl-block" data-block-type="line" style="width: auto; height: auto; min-width: 1px; min-height: 1px; left: 312px; top: 176px;" data-block-id="0418000ee755080e33177b0c0a7cfd55">
|
||
|
<div class="sl-block-content" data-line-x1="0" data-line-y1="200" data-line-x2="-355" data-line-y2="3" data-line-color="#000000" data-line-start-type="none" data-line-end-type="arrow" style="z-index: 11;">
|
||
|
<svg
|
||
|
xmlns="http://www.w3.org/2000/svg" version="1.1" preserveAspectRatio="xMidYMid" width="355" height="197" viewBox="-355 3 355 197">
|
||
|
<line stroke="rgba(0,0,0,0)" stroke-width="15" x1="0" y1="200" x2="-352" y2="5"></line>
|
||
|
<line stroke="#000000" stroke-width="2" x1="0" y1="200" x2="-352" y2="5"></line>
|
||
|
<polygon fill="#000000" transform="translate(-352,5) rotate(-60.973)" points="0,-4 4,4 -4,4"></polygon>
|
||
|
</svg>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="sl-block" data-block-type="text" style="height: auto; width: 380px; left: 80px; top: 370px;" data-block-id="c6837882865b828d4b5ad458b9a2e587">
|
||
|
<div class="sl-block-content" data-placeholder-tag="p" data-placeholder-text="Text" style="z-index: 15;" dir="ui">
|
||
|
<p>Changements distants</p>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="sl-block" data-block-type="line" style="width: auto; height: auto; min-width: 1px; min-height: 1px; left: 171px; top: 247px;" data-block-id="e79641413439b6a2c3b2e197bf5ad34a">
|
||
|
<div class="sl-block-content" data-line-x1="-89" data-line-y1="26" data-line-x2="-158" data-line-y2="-100" data-line-color="#000000" data-line-start-type="none" data-line-end-type="arrow" style="z-index: 16;">
|
||
|
<svg
|
||
|
xmlns="http://www.w3.org/2000/svg" version="1.1" preserveAspectRatio="xMidYMid" width="69" height="126" viewBox="-158 -100 69 126">
|
||
|
<line stroke="rgba(0,0,0,0)" stroke-width="15" x1="-89" y1="26" x2="-156" y2="-96"></line>
|
||
|
<line stroke="#000000" stroke-width="2" x1="-89" y1="26" x2="-156" y2="-96"></line>
|
||
|
<polygon fill="#000000" transform="translate(-156,-96) rotate(-28.706)" points="0,-4 4,4 -4,4"></polygon>
|
||
|
</svg>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="sl-block" data-block-type="text" style="height: auto; min-width: 30px; min-height: 30px; width: 804px; left: 80px; top: 459px;" data-block-id="960b29ba2af6fc6eb1e9208a152db7f6">
|
||
|
<div class="sl-block-style" style="z-index: 17; transform: rotate(360deg);">
|
||
|
<div class="sl-block-content" data-placeholder-tag="p" data-placeholder-text="Text" style="z-index: 17;" dir="ui">
|
||
|
<p style="text-align:left">Il faut faire un choix</p>
|
||
|
<p style="text-align:left">Un nouveau commit doit être réalisé pour résoudre le conflit</p>
|
||
|
<p style="text-align:left">
|
||
|
<code>$ git add .</code>
|
||
|
</p>
|
||
|
<p style="text-align:left">
|
||
|
<code>$ git commit -m "fix(conflict)"</code>
|
||
|
</p>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|