Hoe om 'n pleister aan te pas op 'n lêer wat Linux gebruik

Hierdie gids bied 'n basiese oorsig vir die toepassing van 'n pleister op 'n program of lêer.

Die opdrag wat gebruik word om patches toe te pas, is die patch-opdrag, maar om 'n pleister toe te pas, moet die diff-opdrag ook gebruik word om die verskille wat geplak moet word, te verskaf.

Hoekom sou jy 'n pleister maak

Stel jou voor dat jy ' n HTML-lêer soos volg gehad het:



Gates </ title> <br> </ Head> <br> <Body> <br> <h1> Welkom by MySite </ h1> <br> </ Body> <br> </ Html> </p> <p> Bogenoemde bron wanneer dit in 'n webblaaier gelaai word, sal die woorde "Welkom by MySite" wys. </p> <p> Dit is algemeen wanneer daar vir verskeie weergawes van dieselfde lêer geprogrammeer word. Byvoorbeeld, daar sou een weergawe wees wat die huidige lewende weergawe is, daar sou 'n ander weergawe wees op die ontwikkelingstak wat verskeie veranderings mag bevat, tenslotte is daar dalk 'n ander weergawe op 'n vrystellingstak. </p> <p> Die vrystellingstak sal die weergawe wees wat deur werklike gebruikers gebruik word (dws in hierdie geval besoekers aan die MySite-webwerf). Kom ons sê dat MySite op weergawe 1.0 is. Na 'n ontwikkelingsfase sal jy 'n vrystellingstak skep wat in hierdie geval sal wees 1.1. Die ontwikkelingstak sal voor die vrystellingstak wees, want dit mag veranderinge bevat wat nie in weergawe 1.2 beskikbaar is nie, maar sal vir weergawe 1.1 wees. </p> <p> Stel jou voor dat daar 'n fout was waarby MySite YourSite genoem moet word. U kan op elke tak na elke tak gaan en veranderinge aan die lewendige weergawe maak, ontwikkelingsweergawe en weergawe van u kan die verandering as 'n goeie oplossing in die lewe maak en dan die pleister toepas op die ontwikkeling en takke. </p> <h3> 'N Werklike voorbeeld </h3><p> Skep 'n lêer genaamd myfile.html met die volgende kode daarin: </p> <p> <Html> <br> <Head> <br> <Title> Gates </ title> <br> </ Head> <br> <Body> <br> <h1> Welkom by MySite </ h1> <br> <p> Hierdie is 'n voorbeeld van die laai van bronkode. </ p> <br> </ Body> <br> </ Html> </p> <p> Skep nog 'n lêer genaamd myfile_v2.html met die volgende kode daarin: </p> <p> <Html> <br> <Head> <br> <Title> uwSite </ title> <br> </ Head> <br> <Body> <br> <h1> Welkom by YourSite </ h1> <br> <p> Hierdie is 'n voorbeeld van die laai van bronkode. </ p> <br> </ Body> <br> </ Html> </p> <p> Die eerste lêer is die oorspronklike webblad met die opskrif "Welkom by MySite". Die tweede lêer is dieselfde as die eerste lêer behalwe MyFile word na YourFile in die teks hernoem. </p> <h3> Hoe om die Diff Lêer te skep </h3><p> Om 'n pleister te skep, moet ons die verskille tussen myfile.html en myfile_v2.html uitwerk. </p> <p> Ons kan dit met die diff-opdrag soos volg doen: </p> <p> diff -u myfile.html myfile_v2.html> myfile.patch </p> <p> U kan die myfile.patch-lêer in <a href="https://af.eyewated.com/n-beginnersgids-na-die-nano-redakteur/">die nano-redakteur</a> soos volg oopmaak om dit te bekyk: </p> <p> nano myfile.patch </p> <p> Lyne wat onveranderd is, word in blou vertoon. Lyne wat verwyder is, word in rooi vertoon en lyne wat bygevoeg is, word in groen vertoon. </p> <h3> Hoe om die pleister te gebruik deur die pleister opdrag te gebruik </h3><p> Om die pleister toe te pas op myfile.html, gebruik die volgende opdrag: </p> <p> pleister <myfile.patch </p> <h3> Hoe om 'n pleister te herwin </h3><p> Dit sal die veranderinge wat gemaak is met behulp van die diff-opdrag toepas op die oorspronklike lêer myfile.html. </p> <p> As jy die pleister wil terugbring sodat myfile.html terug is na die manier waarop dit oorspronklik die volgende opdrag gebruik: </p> <p> pleister -R <myfile.patch </p> <h3> opsomming </h3><p> Die patch-opdrag kan gebruik word om patches oor 'n hele gidsstruktuur toe te pas. </p> <p> Daar is baie beter gereedskap as die patch-opdrag om patches te skep en goeie bronbeheer te verseker. </p> <p> Daar is 'n rede dat so baie ontwikkelingsprojekte GIT gebruik vir bronbeheer. GIT maak dit maklik om 'n konsekwente vertakkingsstrategie te skep. </p> <p> Die opdrag van die patch is goed om verskille aan te pas op 'n bash script of iets eenvoudig, maar jy kan net so maklik 'n rugsteunkopie maak van die lêers wat jy wil patch en net die nuwe lêers op dieselfde plek kopieer. </p> <p> Vir meer inligting gebruik die man bevel: </p> <p> man pleister </p> </div> <div class="amp-related-wrapper"> <h2>Alike posts</h2> <div class="amp-related-content"> <a href="https://af.eyewated.com/voorbeeld-gebruik-van-die-linux-host-command/"> <amp-img src="https://exse.eyewated.com/pict/d68871bbaa9233ee-120x86.jpg" width="120" height="86" layout="responsive" class="amp-related-image"></amp-img> </a> <div class="amp-related-text"> <h3><a href="https://af.eyewated.com/voorbeeld-gebruik-van-die-linux-host-command/">Voorbeeld gebruik van die Linux Host Command</a></h3> <div class="amp-related-meta"> Linux </div> </div> </div> <div class="amp-related-content"> <a href="https://af.eyewated.com/locale-linux-command-unix-command/"> <amp-img src="https://exse.eyewated.com/pict/f2be7c41dd5f3ae8-120x86.jpg" width="120" height="86" layout="responsive" class="amp-related-image"></amp-img> </a> <div class="amp-related-text"> <h3><a href="https://af.eyewated.com/locale-linux-command-unix-command/">Locale - Linux Command - Unix Command</a></h3> <div class="amp-related-meta"> Linux </div> </div> </div> <div class="amp-related-content"> <a href="https://af.eyewated.com/linux-unix-command-lpr/"> <amp-img src="https://exse.eyewated.com/pict/5081b2d66451341d-120x86.jpg" width="120" height="86" layout="responsive" class="amp-related-image"></amp-img> </a> <div class="amp-related-text"> <h3><a href="https://af.eyewated.com/linux-unix-command-lpr/">Linux / Unix Command: lpr</a></h3> <div class="amp-related-meta"> Linux </div> </div> </div> <div class="amp-related-content"> <a href="https://af.eyewated.com/gebruik-die-ls-opdrag-om-leers-in-linux-te-lys/"> <amp-img src="https://exse.eyewated.com/pict/3be03de1fe0934da-120x86.jpg" width="120" height="86" layout="responsive" class="amp-related-image"></amp-img> </a> <div class="amp-related-text"> <h3><a href="https://af.eyewated.com/gebruik-die-ls-opdrag-om-leers-in-linux-te-lys/">Gebruik die ls opdrag om lêers in Linux te lys</a></h3> <div class="amp-related-meta"> Linux </div> </div> </div> <div class="amp-related-content"> <a href="https://af.eyewated.com/syslogd-linux-en-unix-command/"> <amp-img src="https://exse.eyewated.com/pict/fef3a8d9f91541e5-120x86.jpg" width="120" height="86" layout="responsive" class="amp-related-image"></amp-img> </a> <div class="amp-related-text"> <h3><a href="https://af.eyewated.com/syslogd-linux-en-unix-command/">Syslogd Linux en Unix Command</a></h3> <div class="amp-related-meta"> Linux </div> </div> </div> <div class="amp-related-content"> <a href="https://af.eyewated.com/met-behulp-van-nice-en-renice-opdragte-in-linux/"> <amp-img src="https://exse.eyewated.com/pict/5ad6d75ca5ca3257-120x86.jpg" width="120" height="86" layout="responsive" class="amp-related-image"></amp-img> </a> <div class="amp-related-text"> <h3><a href="https://af.eyewated.com/met-behulp-van-nice-en-renice-opdragte-in-linux/">Met behulp van "Nice" en "Renice" opdragte in Linux</a></h3> <div class="amp-related-meta"> Linux </div> </div> </div> <div class="amp-related-content"> <div class="amp-related-text"> <h3><a href="https://af.eyewated.com/gebruik-die-ldd-opdrag-in-linux/">Gebruik die ldd-opdrag in Linux</a></h3> <div class="amp-related-meta"> Linux </div> </div> </div> <div class="amp-related-content"> <a href="https://af.eyewated.com/fbset-linux-command-unix-command/"> <amp-img src="https://exse.eyewated.com/pict/ac5d6d806a873b4f-120x86.jpg" width="120" height="86" layout="responsive" class="amp-related-image"></amp-img> </a> <div class="amp-related-text"> <h3><a href="https://af.eyewated.com/fbset-linux-command-unix-command/">Fbset - Linux Command - Unix Command</a></h3> <div class="amp-related-meta"> Linux </div> </div> </div> <div class="amp-related-content"> <a href="https://af.eyewated.com/maak-linux-command-unix-command/"> <amp-img src="https://exse.eyewated.com/pict/599a14ed6ab13445-120x86.jpg" width="120" height="86" layout="responsive" class="amp-related-image"></amp-img> </a> <div class="amp-related-text"> <h3><a href="https://af.eyewated.com/maak-linux-command-unix-command/">Maak - Linux Command - Unix Command</a></h3> <div class="amp-related-meta"> Linux </div> </div> </div> </div> <div class="amp-related-wrapper"> <h2>See Newest</h2> <div class="amp-related-content"> <a href="https://af.eyewated.com/helios-help-om-die-playstation-3-ps3-in-n-linux-bediener-te-maak/"> <amp-img src="https://exse.eyewated.com/pict/98c7a12811003b6b-120x86.jpg" width="120" height="86" layout="responsive" class="amp-related-image"></amp-img> </a> <div class="amp-related-text"> <h3><a href="https://af.eyewated.com/helios-help-om-die-playstation-3-ps3-in-n-linux-bediener-te-maak/">HELIOS help om die PlayStation 3 (PS3) in 'n Linux-bediener te maak</a></h3> <div class="amp-related-meta"> Gaming </div> </div> </div> <div class="amp-related-content"> <a href="https://af.eyewated.com/hoe-om-pppoe-internet-access-op-te-stel/"> <amp-img src="https://exse.eyewated.com/pict/44d8c7ab36e433bc-120x86.jpg" width="120" height="86" layout="responsive" class="amp-related-image"></amp-img> </a> <div class="amp-related-text"> <h3><a href="https://af.eyewated.com/hoe-om-pppoe-internet-access-op-te-stel/">Hoe om PPPoE Internet Access op te stel</a></h3> <div class="amp-related-meta"> Internet & Netwerk </div> </div> </div> <div class="amp-related-content"> <a href="https://af.eyewated.com/maak-n-stamboom-in-powerpoint-2003-gebruik-die-organisasiekaart/"> <amp-img src="https://exse.eyewated.com/pict/46b4372b90cb33cc-120x86.gif" width="120" height="86" layout="responsive" class="amp-related-image"></amp-img> </a> <div class="amp-related-text"> <h3><a href="https://af.eyewated.com/maak-n-stamboom-in-powerpoint-2003-gebruik-die-organisasiekaart/">Maak 'n stamboom in PowerPoint 2003 Gebruik die organisasiekaart</a></h3> <div class="amp-related-meta"> Sagteware </div> </div> </div> <div class="amp-related-content"> <a href="https://af.eyewated.com/leer-hoe-om-die-krag-van-google-tendense-te-benut/"> <amp-img src="https://exse.eyewated.com/pict/4143a469da623faf-120x86.jpg" width="120" height="86" layout="responsive" class="amp-related-image"></amp-img> </a> <div class="amp-related-text"> <h3><a href="https://af.eyewated.com/leer-hoe-om-die-krag-van-google-tendense-te-benut/">Leer hoe om die krag van Google-tendense te benut</a></h3> <div class="amp-related-meta"> Web & Soek </div> </div> </div> <div class="amp-related-content"> <a href="https://af.eyewated.com/internet-protocol-ip-handleiding/"> <amp-img src="https://exse.eyewated.com/pict/84e6b0bd73a63037-120x86.jpg" width="120" height="86" layout="responsive" class="amp-related-image"></amp-img> </a> <div class="amp-related-text"> <h3><a href="https://af.eyewated.com/internet-protocol-ip-handleiding/">Internet Protocol (IP) handleiding</a></h3> <div class="amp-related-meta"> Internet & Netwerk </div> </div> </div> <div class="amp-related-content"> <div class="amp-related-text"> <h3><a href="https://af.eyewated.com/die-8-beste-samsung-toestelle-om-in-2018-te-koop/">Die 8 beste Samsung-toestelle om in 2018 te koop</a></h3> <div class="amp-related-meta"> Koop wenke </div> </div> </div> </div> <div class="amp-related-wrapper"> <h2>Sapid posts</h2> <div class="amp-related-content"> <a href="https://af.eyewated.com/skype-konferensie-oproepvereistes/"> <amp-img src="https://exse.eyewated.com/pict/3adc16db0cab3096-120x86.jpg" width="120" height="86" layout="responsive" class="amp-related-image"></amp-img> </a> <div class="amp-related-text"> <h3><a href="https://af.eyewated.com/skype-konferensie-oproepvereistes/">Skype-konferensie-oproepvereistes</a></h3> <div class="amp-related-meta"> E-pos en boodskappe </div> </div> </div> <div class="amp-related-content"> <a href="https://af.eyewated.com/waar-is-die-ikoon-show-desktop-in-windows-7-en-hoer/"> <amp-img src="https://exse.eyewated.com/pict/834bc3c78b89365f-120x86.png" width="120" height="86" layout="responsive" class="amp-related-image"></amp-img> </a> <div class="amp-related-text"> <h3><a href="https://af.eyewated.com/waar-is-die-ikoon-show-desktop-in-windows-7-en-hoer/">Waar is die ikoon 'Show Desktop' in Windows 7 en hoër?</a></h3> <div class="amp-related-meta"> Windows </div> </div> </div> <div class="amp-related-content"> <a href="https://af.eyewated.com/google-hangouts-kom-met-n-paar-koel-ekstras/"> <amp-img src="https://exse.eyewated.com/pict/31225e968e7834df-120x86.png" width="120" height="86" layout="responsive" class="amp-related-image"></amp-img> </a> <div class="amp-related-text"> <h3><a href="https://af.eyewated.com/google-hangouts-kom-met-n-paar-koel-ekstras/">Google Hangouts kom met 'n paar koel ekstras</a></h3> <div class="amp-related-meta"> Web & Soek </div> </div> </div> <div class="amp-related-content"> <a href="https://af.eyewated.com/hoe-om-op-te-stel-en-te-gebruik-moenie-steur-op-iphone-en-apple-watch-nie/"> <amp-img src="https://exse.eyewated.com/pict/c988089465f83446-120x86.jpg" width="120" height="86" layout="responsive" class="amp-related-image"></amp-img> </a> <div class="amp-related-text"> <h3><a href="https://af.eyewated.com/hoe-om-op-te-stel-en-te-gebruik-moenie-steur-op-iphone-en-apple-watch-nie/">Hoe om op te stel en te gebruik, moenie steur op iPhone en Apple Watch nie</a></h3> <div class="amp-related-meta"> IPhone en iPod </div> </div> </div> <div class="amp-related-content"> <a href="https://af.eyewated.com/olympus-stylus-sh-2-review/"> <amp-img src="https://exse.eyewated.com/pict/85aef36088e2323c-120x86.jpg" width="120" height="86" layout="responsive" class="amp-related-image"></amp-img> </a> <div class="amp-related-text"> <h3><a href="https://af.eyewated.com/olympus-stylus-sh-2-review/">Olympus Stylus SH-2 Review</a></h3> <div class="amp-related-meta"> Produk Resensies </div> </div> </div> <div class="amp-related-content"> <a href="https://af.eyewated.com/wat-is-n-easm-leer/"> <amp-img src="https://exse.eyewated.com/pict/6a9c1ff3a7db3072-120x86.png" width="120" height="86" layout="responsive" class="amp-related-image"></amp-img> </a> <div class="amp-related-text"> <h3><a href="https://af.eyewated.com/wat-is-n-easm-leer/">Wat is 'n EASM-lêer?</a></h3> <div class="amp-related-meta"> Windows </div> </div> </div> <div class="amp-related-content"> <a href="https://af.eyewated.com/hoe-om-jou-ipad-te-beskerm/"> <amp-img src="https://exse.eyewated.com/pict/e8078ef7fb033876-120x86.jpg" width="120" height="86" layout="responsive" class="amp-related-image"></amp-img> </a> <div class="amp-related-text"> <h3><a href="https://af.eyewated.com/hoe-om-jou-ipad-te-beskerm/">Hoe om jou iPad te beskerm</a></h3> <div class="amp-related-meta"> IPad </div> </div> </div> <div class="amp-related-content"> <a href="https://af.eyewated.com/speccy-v1-31-732/"> <amp-img src="https://exse.eyewated.com/pict/0144119397913051-120x86.png" width="120" height="86" layout="responsive" class="amp-related-image"></amp-img> </a> <div class="amp-related-text"> <h3><a href="https://af.eyewated.com/speccy-v1-31-732/">Speccy v1.31.732</a></h3> <div class="amp-related-meta"> Sagteware en programme </div> </div> </div> <div class="amp-related-content"> <a href="https://af.eyewated.com/alles-wat-jy-moet-weet-oor-jou-twitter-avatar/"> <amp-img src="https://exse.eyewated.com/pict/d7ee6bac4dfc33ca-120x86.jpg" width="120" height="86" layout="responsive" class="amp-related-image"></amp-img> </a> <div class="amp-related-text"> <h3><a href="https://af.eyewated.com/alles-wat-jy-moet-weet-oor-jou-twitter-avatar/">Alles wat jy moet weet oor jou Twitter Avatar</a></h3> <div class="amp-related-meta"> Sosiale media </div> </div> </div> <div class="amp-related-content"> <a href="https://af.eyewated.com/wat-is-n-azw-leer/"> <amp-img src="https://exse.eyewated.com/pict/e9adffd83b7931cc-120x86.png" width="120" height="86" layout="responsive" class="amp-related-image"></amp-img> </a> <div class="amp-related-text"> <h3><a href="https://af.eyewated.com/wat-is-n-azw-leer/">Wat is 'n AZW-lêer?</a></h3> <div class="amp-related-meta"> Windows </div> </div> </div> <div class="amp-related-content"> <a href="https://af.eyewated.com/dit-is-wat-google-tracks-oor-jou/"> <amp-img src="https://exse.eyewated.com/pict/fc347b4414213757-120x86.png" width="120" height="86" layout="responsive" class="amp-related-image"></amp-img> </a> <div class="amp-related-text"> <h3><a href="https://af.eyewated.com/dit-is-wat-google-tracks-oor-jou/">Dit is wat Google Tracks oor jou</a></h3> <div class="amp-related-meta"> Web & Soek </div> </div> </div> <div class="amp-related-content"> <a href="https://af.eyewated.com/kan-minecraft-switch-it-up/"> <amp-img src="https://exse.eyewated.com/pict/a36567d330372fdb-120x86.jpg" width="120" height="86" layout="responsive" class="amp-related-image"></amp-img> </a> <div class="amp-related-text"> <h3><a href="https://af.eyewated.com/kan-minecraft-switch-it-up/">Kan Minecraft "Switch" It Up?</a></h3> <div class="amp-related-meta"> Gaming </div> </div> </div> <div class="amp-related-content"> <a href="https://af.eyewated.com/wat-is-n-draagbare-media-speler-pmp/"> <amp-img src="https://exse.eyewated.com/pict/8aeee714b246348c-120x86.jpg" width="120" height="86" layout="responsive" class="amp-related-image"></amp-img> </a> <div class="amp-related-text"> <h3><a href="https://af.eyewated.com/wat-is-n-draagbare-media-speler-pmp/">Wat is 'n draagbare media speler (PMP)?</a></h3> <div class="amp-related-meta"> Web & Soek </div> </div> </div> <div class="amp-related-content"> <a href="https://af.eyewated.com/musiek-byvoeg-en-verwyder-in-windows-media-player-12/"> <amp-img src="https://exse.eyewated.com/pict/c7a409072a8436ab-120x86.jpg" width="120" height="86" layout="responsive" class="amp-related-image"></amp-img> </a> <div class="amp-related-text"> <h3><a href="https://af.eyewated.com/musiek-byvoeg-en-verwyder-in-windows-media-player-12/">Musiek byvoeg en verwyder in Windows Media Player 12</a></h3> <div class="amp-related-meta"> Sagteware en programme </div> </div> </div> <div class="amp-related-content"> <a href="https://af.eyewated.com/wat-is-xbox-live/"> <amp-img src="https://exse.eyewated.com/pict/8777eddb676337eb-120x86.jpg" width="120" height="86" layout="responsive" class="amp-related-image"></amp-img> </a> <div class="amp-related-text"> <h3><a href="https://af.eyewated.com/wat-is-xbox-live/">Wat is Xbox Live?</a></h3> <div class="amp-related-meta"> Gaming </div> </div> </div> <div class="amp-related-content"> <a href="https://af.eyewated.com/wat-is-n-leesalleenleer/"> <amp-img src="https://exse.eyewated.com/pict/39a0a9fca7593afe-120x86.jpg" width="120" height="86" layout="responsive" class="amp-related-image"></amp-img> </a> <div class="amp-related-text"> <h3><a href="https://af.eyewated.com/wat-is-n-leesalleenleer/">Wat is 'n leesalleenlêer?</a></h3> <div class="amp-related-meta"> Windows </div> </div> </div> </div></article> <footer class="amp-wp-footer"> <div class="amp-wp-footer-inner"> <a href="#" class="back-to-top">Back to top</a> <p class="copyright"> © 2024 af.eyewated.com </p> <div class="amp-wp-social-footer"> <a href="#" class="jeg_facebook"><i class="fa fa-facebook"></i> </a><a href="#" class="jeg_twitter"><i class="fa fa-twitter"></i> </a><a href="#" class="jeg_google-plus"><i class="fa fa-google-plus"></i> </a><a href="#" class="jeg_pinterest"><i class="fa fa-pinterest"></i> </a><a href="" class="jeg_rss"><i class="fa fa-rss"></i> </a> </div> </div> </footer> <div id="statcounter"> <amp-pixel src="https://c.statcounter.com/12022999/0/02d06b5d/1/"> </amp-pixel> </div> </body> </html> <!-- Dynamic page generated in 1.217 seconds. --> <!-- Cached page generated by WP-Super-Cache on 2019-10-03 21:26:45 --> <!-- 0.002 -->