Tutorial Git Diff
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
- Git, General in Git
- GitHub, General on GetHub.
- Tutorial Git Add, Tutorial on 'git add'.
- Tutorial Git Commit, Tutorial on 'git commit'.
Reference
- ↑ Version Control with Git, Powerful Tools and Techniques for Collaborative Software Development, Jon Loeniger & Matthew McCullough, O'Reilly, 2012 Second Edition, isbn: 9781449316389.