Tutorial Git Diff

From HaFrWiki
Revision as of 14:22, 10 July 2017 by Hjmf (talk | contribs) (Created page with "{{TOCright}} Shows the {{FormFCT|9|blue|git diff}} command in detail. <br>The example is a written example from Version Control with Git <ref>Version Control with Git, Powerfu...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Shows the git diff command in detail.
The example is a written example from Version Control with Git [1]

Introduction

A diff is a compact summary of the differences (hence the name “diff”) between two items.
For example, given two files, the Unix and Linux diff command compares the files line by line and summarizes the deviations in a diff. <syntaxhighlight lang="bash"> $ cat initial Now is the time For all good men To come to the aid Of their country.

$ cat rewrite Today is the time For all good men And women To come to the aid Of their country.

$ diff -u initial rewrite --- initial 1867-01-02 11:22:33.000000000 -0500 +++ rewrite 2000-01-02 11:23:45.000000000 -0500 @@ -1,4 +1,5 @@ -Now is the time +Today is the time

 For all good men

+And women

 To come to the aid 
 Of their country.

</syntaxhighlight>

See also

top

Reference

top

  1. Version Control with Git, Powerful Tools and Techniques for Collaborative Software Development, Jon Loeniger & Matthew McCullough, O'Reilly, 2012 Second Edition, isbn: 9781449316389.