Patches tau dav siv nyob rau hauv UNIX-zoo li cov tshuab los nthuav tawm cov kev hloov me me uas tau tsim los ua cov txheej txheem cov ntaub ntawv sib txawv (piv txwv, software source code). Lawv tsuas yog muaj cov ntaub ntawv hais txog cov kev kho uas yuav tsum tau ua rau cov ntaub ntawv qub los hloov nws rau nws lub xeev tam sim no.
Tsim nyog
ntsia hluav taws xob sib txawv
Cov Lus Qhia
Kauj ruam 1
Npaj cov ntaub ntawv xa tawm nrog cov ntaub ntawv uas koj yuav tsim kom muaj kev hloov pauv. Cov ntaub ntawv hauv cov ntawv tuaj yeem yog ob phau ntawv thiab binary
Kauj ruam 2
Tsim ib qho duplicate ntawm cov ntaub ntawv npaj hauv thawj kauj ruam. Luam nws rau lwm phau ntawv teev npe uas muaj tib lub npe lossis rau cov ntawv qhia tam sim no tab sis nrog lub npe txawv
Kauj ruam 3
Hloov cov ntawv theej tawm uas tsim nyob rau hauv cov kauj ruam dhau los. Kho cov ntawv sau raws li tsim nyog hauv ib tus kws kho kom raug, lossis sau dua rau hauv cov ntaub ntawv nrog rau daim ntawv thov npaj los ua haujlwm nrog nws
Kauj ruam 4
Txheeb xyuas cov ntaub ntawv ntawm kev siv hluav taws xob txawv. Pib lub davhlau ya nyob twg emulator lossis hloov mus rau lub console. Khiav qhov hais kom ua: diff - pab los qhia kev pab online. Sim cov lus txib: txiv neej diff lossis info sib txawv los tso cov nplooj ntawv tsim nyog, yog tias ntsia. Ua tib zoo saib xyuas cov kev xaiv -a, -c (-C), -e, - txawv, thiab -n (--rsc)
Kauj ruam 5
Tsim ib thaj. Khiav cov diff hais nrog cov kev xaiv uas koj xav tau, redirecting nws cov zis rau ib daim ntawv. Qhia cov thawj thiab cov ntaub ntawv hloov kho uas tsis ua raws li cov kev xaiv. Cov piv txwv yooj yim ntawm kev siv diff los tsim ib thaj ua raws li cov ntaub ntawv los ntawm cov ntaub ntawv nyob rau hauv cov lus qhia tam sim no yuav zoo li no: diff source.txt hloov.txt> sample.patc
Kauj Ruam 6
Saib cov thaj generated. Siv cov ntawv xov xwm tsim nyog, lossis luam tawm nws cov ntsiab lus rau lub console nrog cov miv hais kom ua. Piv txwv li: cat sample.patch lossis cat sample.patch | ntxi
Kauj Ruam 7
Tshawb xyuas qhov tseeb ntawm cov ntaub ntawv hloov tsim. Siv lub thaj hais kom ua. Tshaj tawm txoj kev thaj rau nws nrog kev xaiv -i. Siv qhov kev xaiv -o los muab cov npe filename rau qhov tshwm sim. Qhov no yuav tiv thaiv sau cov ntawv thawj, txoj hauv kev uas yuav tsum tau teev tseg cia yog qhov kev ntsuas dhau los. Piv txwv li: thaj -i sample.patch -o test.txt source.txt Piv rau cov ntaub ntawv tsim tawm thiab ib qho uas tau tsim hauv kauj ruam thib peb. Lawv yuav tsum zoo ib yam. Khiav cov ntaub ntawv thaj nrog nrog --dry-run thiab --verbose tsis tau, dhau ntawm kev sib cav thiab kev sib cav kawg rau cov ntaub ntawv thiab thaj ua cov npe: thaj - dry-run --verbose source.txt sample.patch Tsis muaj kev hloov pauv yuav ua rau cov ntaub ntawv, tab sis ib daim ntawv qhia ntxaws txog kev nqis tes uas yuav tau ua yog tias qhov kev txiav txim tau ua tiav yuav raug muab tso tawm. Nws kuj tseem siv tau los txiav txim siab qhov tseeb ntawm daim npog tsim.