{"id":34597,"date":"2016-03-10T15:00:05","date_gmt":"2016-03-10T13:00:05","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=34597"},"modified":"2019-04-23T14:55:05","modified_gmt":"2019-04-23T11:55:05","slug":"git-diff-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-diff-example\/","title":{"rendered":"Git Diff Example"},"content":{"rendered":"<h2>1. Introduction<\/h2>\n<p>As we all know, <code>Git<\/code> has been a very popular source code management system for software development. It has been widely used among programmers. Compared with <code>SVN<\/code> (Apache Subversion) and <code>CVS<\/code> (Concurrent Version System), Git is more powerful for its distributed nature, fast operation and branch handling mechanism. Because of the efficient of <code>Git<\/code>, Github, which is the web-based repository hosting service platform, is also popularly used.<\/p>\n<p>In this article, <code>Git<\/code>, specifically Git Diff command will be discussed. All the examples below is shown in MacOS EI Capitan Version 10.11.3 and the Git version is 2.5.4. Note all the operations below is working on local machine, without connecting to <code>Github<\/code>.\n<\/p>\n<h2>2. Git Diff Example<\/h2>\n<h3>2.1 Basic operation before going to Git Diff example<\/h3>\n<p>Before we go to the detailed example, maker sure git is installed on your computer\/laptop. Follow the <a href=\"https:\/\/git-scm.com\/book\/en\/v2\/Getting-Started-Installing-Git\" target=\"_blank\" rel=\"noopener noreferrer\">link here<\/a>, you&#8217;ll fine the way to install <code>Git<\/code> successfully. Then in the terminal, try to run <code>git --version<\/code>, you will see the version of the <code>Git<\/code> you&#8217;ve installed as below:<\/p>\n<pre class=\"brush:bash\">WXMs-MacBook-Pro:~ WXM$ git --version\ngit version 2.5.4 (Apple Git-61)\n<\/pre>\n<p>After the successful installation of <code>Git<\/code>, we need to be able to handle the some basic operation of it.<\/p>\n<p>Firstly, create a blank folder named GitDiffExample. Then go into the folder and type command <code>git init<\/code>. This command will change this folder to be a repository which you can manage. Also, the output after you type <code>git init<\/code> shows that you&#8217;ve successfully created and initialized an empty git repository. After running <code>ls -ah<\/code>, you will see there&#8217;s a .git folder inside the GitDiffExample folder. This folder is utilized to track the git folder. Make sure you won&#8217;t change it, leading to errors happening to the whole git folder. Note that .git folder is hidden by default, and you can use the previous command to make it visible.<\/p>\n<p>For all these operations, you can check the result below:<\/p>\n<pre class=\"brush:bash\">WXMs-MacBook-Pro:~ WXM$ cd Documents\/\nWXMs-MacBook-Pro:Documents WXM$ cd GitDiffExample\/\nWXMs-MacBook-Pro:GitDiffExample WXM$ ls\nWXMs-MacBook-Pro:GitDiffExample WXM$ git init\nInitialized empty Git repository in \/Users\/WXM\/Documents\/GitDiffExample\/.git\/\nWXMs-MacBook-Pro:GitDiffExample WXM$ ls -ah\n.\t..\t.git\n<\/pre>\n<p>Secondly, we can use a text file as an example in usage of <code>Git<\/code>. Inside the GitDiffExample folder, create an empty txt file with name GitDiff.txt. Then add any words in it with: This is a txt file for Git Diff Example.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>Lastly, we need to add the GitDiff file into the <code>Git<\/code> system. Then run <code>git add GitDiff.txt<\/code>. This command will add the txt file to the stage area, which is a middle area between workspace and the local repository. Then, we need to add this file from stage area to local repository. To achieve this, we can run <code>git commit -m \"First time writing the txt file\"<\/code>. Note the string after -m is the comment that we make by ourselves. It can be anything you want to comment. Below shows the results of all these operations.<\/p>\n<pre class=\"brush:bash\">WXMs-MacBook-Pro:GitDiffExample WXM$ vi GitDiff.txt\nWXMs-MacBook-Pro:GitDiffExample WXM$ ls\nGitDiff.txt\nWXMs-MacBook-Pro:GitDiffExample WXM$ cat GitDiff.txt \nThis is a txt file for Git Diff Example.\nWXMs-MacBook-Pro:GitDiffExample WXM$ git add GitDiff.txt \nWXMs-MacBook-Pro:GitDiffExample WXM$ git commit -m \"First time writing the txt file\"\n[master (root-commit) 9f3fca6] First time writing the txt file\n 1 file changed, 1 insertion(+)\n create mode 100644 GitDiff.txt\n<\/pre>\n<p>To make you more comfortable with the workspace, index, local repository, you can refer to an <a href=\"http:\/\/veerasundar.com\/blog\/2011\/06\/git-tutorial-getting-started\/\" target=\"_blank\" rel=\"noopener noreferrer\">article here<\/a> for further information.<\/p>\n<p>Afterward, we can check the status of the whole folder with command <code>git status<\/code>. Then it seems to be everything if fine until now.<\/p>\n<pre class=\"brush:bash\">WXMs-MacBook-Pro:GitDiffExample WXM$ git status\nOn branch master\nnothing to commit, working directory clean\n<\/pre>\n<h3>2.2 Git Diff example<\/h3>\n<p>With familiar with the operations above, we&#8217;ll move to the main topic for <code>git diff<\/code>. The main purpose for this command is to show changes of the file between commits, commit and working tree, etc.<\/p>\n<p>To make it work, we need to create some differences. As a start, we modify the content in the GitDiff.txt file and add one more line with &#8220;One more line&#8221;. The content in side the txt file now is:<\/p>\n<pre class=\"brush:bash\">This is a txt file for Git Diff Example.\nOne more line.\n<\/pre>\n<p>Then run command <code>git diff<\/code>, the output is:<\/p>\n<pre class=\"brush:bash\">WXMs-MacBook-Pro:GitDiffExample WXM$ git diff\ndiff --git a\/GitDiff.txt b\/GitDiff.txt\nindex 30e6813..8c7c8d2 100644\n--- a\/GitDiff.txt\n+++ b\/GitDiff.txt\n@@ -1 +1,2 @@\n This is a txt file for Git Diff Example.\n+One more line.\n<\/pre>\n<p>Basically the above output means that another line is added to the previous GitDiff.txt file. The &#8220;+&#8221; in the front shows which content has been added. The <code>git diff<\/code> will show the difference between the working directory and the index\/staging area.[ulp id=&#8217;pzgfvmZhgslwSymm&#8217;]<\/p>\n<p>Another useful <code>git diff<\/code> command is <code>git diff --cached<\/code>, it&#8217;ll show the differences between the index and the most recent commit. After running this command in our example, it sows nothing. The reason for this, is that until now, there&#8217;s no difference between the index and most recent commit.<\/p>\n<p>Then if we want to check the difference between the working directory and he most recent commit, <code>git diff HEAD<\/code> could be used. The output after running this command is:<\/p>\n<pre class=\"brush:bash\">diff --git a\/GitDiff.txt b\/GitDiff.txt\nindex 30e6813..8c7c8d2 100644\n--- a\/GitDiff.txt\n+++ b\/GitDiff.txt\n@@ -1 +1,2 @@\n This is a txt file for Git Diff Example.\n+One more line.\n<\/pre>\n<p>Here, we check the status of our current system, with the help of <code>git status<\/code>:<\/p>\n<pre class=\"brush:bash\">WXMs-MacBook-Pro:GitDiffExample WXM$ git status\nOn branch master\nChanges not staged for commit:\n  (use \"git add ...\" to update what will be committed)\n  (use \"git checkout -- ...\" to discard changes in working directory)\n\n\tmodified:   GitDiff.txt\n\nno changes added to commit (use \"git add\" and\/or \"git commit -a\")\n<\/pre>\n<p>If we add the txt file to the index with command <code>git add GitDiff.txt<\/code>, then run the <code>git diff<\/code>, it shows nothing. That&#8217;s because right now the content in the working directory and the index are the same. This time, we run the <code>git diff --cached<\/code>, it shows the content below instead of showing nothing as previous.<\/p>\n<pre class=\"brush:bash\">WXMs-MacBook-Pro:GitDiffExample WXM$ git diff --cached\ndiff --git a\/GitDiff.txt b\/GitDiff.txt\nindex 30e6813..8c7c8d2 100644\n--- a\/GitDiff.txt\n+++ b\/GitDiff.txt\n@@ -1 +1,2 @@\n This is a txt file for Git Diff Example.\n+One more line.\n<\/pre>\n<p>To check the status, run <code>git status<\/code>:<\/p>\n<pre class=\"brush:bash\">WXMs-MacBook-Pro:GitDiffExample WXM$ git status\nOn branch master\nChanges to be committed:\n  (use \"git reset HEAD ...\" to unstage)\n\n\tmodified:   GitDiff.txt\n<\/pre>\n<p>Until now, there&#8217;s still difference between the index and the most recently commit. It can be proved by running <code>git diff HEAD<\/code><\/p>\n<pre class=\"brush:bash\">WXMs-MacBook-Pro:GitDiffExample WXM$ git diff HEAD\ndiff --git a\/GitDiff.txt b\/GitDiff.txt\nindex 30e6813..8c7c8d2 100644\n--- a\/GitDiff.txt\n+++ b\/GitDiff.txt\n@@ -1 +1,2 @@\n This is a txt file for Git Diff Example.\n+One more line.\n<\/pre>\n<p>However, after we commit the file and rerun the previous command again, it shows nothing.<\/p>\n<pre class=\"brush:bash\">WXMs-MacBook-Pro:GitDiffExample WXM$ git commit -m \"Add one more line\"\n[master cb3db9a] Add one more line\n 1 file changed, 1 insertion(+)\n<\/pre>\n<p>Also, the status is clear right now, if we run the <code>git status<\/code><\/p>\n<pre class=\"brush:bash\">WXMs-MacBook-Pro:GitDiffExample WXM$ git status\nOn branch master\nnothing to commit, working directory clean\n<\/pre>\n<h2>3. Conclusion<\/h2>\n<p><code>git diff<\/code> command shows the difference between the files in working directory, index and most recent commit. The three most often used <code>git diff<\/code> commands could be:<\/p>\n<ul>\n<li>git diff: Show differences between the working directory and the index.<\/li>\n<li>git diff -\u2013cached: Show differences between the index and the most recent commit.<\/li>\n<li>git diff HEAD: Show the differences between your working directory and the most recent commit.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>1. Introduction As we all know, Git has been a very popular source code management system for software development. It has been widely used among programmers. Compared with SVN (Apache Subversion) and CVS (Concurrent Version System), Git is more powerful for its distributed nature, fast operation and branch handling mechanism. Because of the efficient of &hellip;<\/p>\n","protected":false},"author":73,"featured_media":27377,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1353],"tags":[1402],"class_list":["post-34597","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-git","tag-git-diff"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Git Diff Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"1. Introduction As we all know, Git has been a very popular source code management system for software development. It has been widely used among\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-diff-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Git Diff Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"1. Introduction As we all know, Git has been a very popular source code management system for software development. It has been widely used among\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-diff-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Examples Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2016-03-10T13:00:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-04-23T11:55:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jun Wu\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jun Wu\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-diff-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-diff-example\/\"},\"author\":{\"name\":\"Jun Wu\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/6593091dba631ca0f41c4ba4e7c97678\"},\"headline\":\"Git Diff Example\",\"datePublished\":\"2016-03-10T13:00:05+00:00\",\"dateModified\":\"2019-04-23T11:55:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-diff-example\/\"},\"wordCount\":842,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-diff-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg\",\"keywords\":[\"Git diff\"],\"articleSection\":[\"Git\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-diff-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-diff-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-diff-example\/\",\"name\":\"Git Diff Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-diff-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-diff-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg\",\"datePublished\":\"2016-03-10T13:00:05+00:00\",\"dateModified\":\"2019-04-23T11:55:05+00:00\",\"description\":\"1. Introduction As we all know, Git has been a very popular source code management system for software development. It has been widely used among\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-diff-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-diff-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-diff-example\/#primaryimage\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-diff-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/examples.javacodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Software Development\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/software-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Git\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/software-development\/git\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Git Diff Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Examples and Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/javacodegeeks\",\"https:\/\/x.com\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/6593091dba631ca0f41c4ba4e7c97678\",\"name\":\"Jun Wu\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/11\/Jun-Wu-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/11\/Jun-Wu-96x96.jpg\",\"caption\":\"Jun Wu\"},\"description\":\"Jun (Steven) Wu is a current Master student in Computer Science &amp; Engineering department of University of Nebraska Lincoln (Lincoln, NE, USA). His current interests focus on Programming Languages (Java, Python), Relational Database (MySQL), NoSQL Database (Apache Cassandra, MongoDB), and Computer Networks.\",\"sameAs\":[\"https:\/\/wuxiaomin98.wordpress.com\/\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/jun-wu\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Git Diff Example - Java Code Geeks","description":"1. Introduction As we all know, Git has been a very popular source code management system for software development. It has been widely used among","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-diff-example\/","og_locale":"en_US","og_type":"article","og_title":"Git Diff Example - Java Code Geeks","og_description":"1. Introduction As we all know, Git has been a very popular source code management system for software development. It has been widely used among","og_url":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-diff-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2016-03-10T13:00:05+00:00","article_modified_time":"2019-04-23T11:55:05+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg","type":"image\/jpeg"}],"author":"Jun Wu","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Jun Wu","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-diff-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-diff-example\/"},"author":{"name":"Jun Wu","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/6593091dba631ca0f41c4ba4e7c97678"},"headline":"Git Diff Example","datePublished":"2016-03-10T13:00:05+00:00","dateModified":"2019-04-23T11:55:05+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-diff-example\/"},"wordCount":842,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-diff-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg","keywords":["Git diff"],"articleSection":["Git"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-diff-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-diff-example\/","url":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-diff-example\/","name":"Git Diff Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-diff-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-diff-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg","datePublished":"2016-03-10T13:00:05+00:00","dateModified":"2019-04-23T11:55:05+00:00","description":"1. Introduction As we all know, Git has been a very popular source code management system for software development. It has been widely used among","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-diff-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-diff-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-diff-example\/#primaryimage","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-diff-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/examples.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Software Development","item":"https:\/\/examples.javacodegeeks.com\/category\/software-development\/"},{"@type":"ListItem","position":3,"name":"Git","item":"https:\/\/examples.javacodegeeks.com\/category\/software-development\/git\/"},{"@type":"ListItem","position":4,"name":"Git Diff Example"}]},{"@type":"WebSite","@id":"https:\/\/examples.javacodegeeks.com\/#website","url":"https:\/\/examples.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Examples and Code Snippets","publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/examples.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/examples.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/6593091dba631ca0f41c4ba4e7c97678","name":"Jun Wu","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/11\/Jun-Wu-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/11\/Jun-Wu-96x96.jpg","caption":"Jun Wu"},"description":"Jun (Steven) Wu is a current Master student in Computer Science &amp; Engineering department of University of Nebraska Lincoln (Lincoln, NE, USA). His current interests focus on Programming Languages (Java, Python), Relational Database (MySQL), NoSQL Database (Apache Cassandra, MongoDB), and Computer Networks.","sameAs":["https:\/\/wuxiaomin98.wordpress.com\/"],"url":"https:\/\/examples.javacodegeeks.com\/author\/jun-wu\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/34597","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/users\/73"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=34597"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/34597\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media\/27377"}],"wp:attachment":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=34597"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=34597"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=34597"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}