Linux & Terminali

diff & patch

Në shqip: diff dhe patch

ShpjegimiSQ

diff krahason dy skedarë dhe shfaq rreshtat që ndryshojnë. Me -u jep formatin që njeh edhe Git. patch e merr atë ndryshim dhe e aplikon mbi një skedar tjetër.

EnglishEN

diff compares two files and shows the lines that differ. With -u it uses the format Git also uses. patch takes that change and applies it to another file.

Si ta mendosh

Si „gjej ndryshimet“ mes dy fotove.

Lexoje në anglisht

Like a spot-the-difference game between two pictures.

Shembull kodibash

diff -u config.old config.new
diff -u a.txt b.txt > ndryshim.patch
patch a.txt < ndryshim.patch

Terma të lidhur