{"id":71848,"date":"2019-06-10T11:00:58","date_gmt":"2019-06-10T08:00:58","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=71848"},"modified":"2019-06-05T12:25:26","modified_gmt":"2019-06-05T09:25:26","slug":"git-apply-patch-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-apply-patch-example\/","title":{"rendered":"Git apply patch Example"},"content":{"rendered":"<h2 class=\"wp-block-heading\">1. Introduction to Git<\/h2>\n<p>In this post, we feature a comprehensive article on Git apply patch. Git is a distributed version control system for tracking changes in source code during software development. It is designed for coordinating work among programmers, but it can be used to track changes in any set of files. Its goals include speed, data integrity and support for distributed, non-linear workflows. Git is free and open-source software distributed under the terms of the GNU General Public License version 2.<\/p>\n<p>The major difference between Git and any other VCS is the way Git thinks about its data. Conceptually, most other systems store information as a list of file-based changes. Git thinks of its data more like a set of snapshots of a mini filesystem. Every time you commit or save the state of your project in Git, it basically takes a picture of what all your files look like at that moment and stores a reference to that snapshot. To be efficient, if files have not changed, Git doesn\u2019t store the file again\u2014just a link to the previous identical file it has already stored. Git has detailed documentation specified in the <a href=\"https:\/\/git-scm.com\/book\/en\/v1\/Getting-Started\">URL<\/a>.<\/p>\n<\/p>\n<div class=\"tip\"><strong>Tip<\/strong><\/br>You may skip Git basics if you are already familiar and jump directly to the <a href=\"#code\"><strong>beginning of the example<\/strong><\/a> below.<\/div>\n<h3 class=\"wp-block-heading\">1.1 Git Commands<\/h3>\n<p>These are some of the common git commands which are useful<\/p>\n<p><span style=\"text-decoration:underline\"><em>Status Command<\/em><\/span><\/p>\n<pre class=\"brush:bash;\">git status\n<\/pre>\n<p>This is used to add the check the status of all the files under git consideration<\/p>\n<ul class=\"wp-block-list\">\n<li>untracked \u2013 This is the initial state. The file is not tracked by git so far and will be tracked after adding to the local repository.<\/li>\n<li>staged- This is the state for a tracked file but the latest changes have not been committed.<\/li>\n<li>Committed \u2013 The file has been committed to the local repository but it is not available in the remote repository.<\/li>\n<\/ul>\n<p><span style=\"text-decoration:underline\"><em>Add Command<\/em><\/span><\/p>\n<pre class=\"brush:bash;\">git add &lt;filename&gt;\n<\/pre>\n<p>This is used to add the file to the local repository for committing. The file is supposed to be in staged state once the command has been executed<\/p>\n<p><span style=\"text-decoration:underline\"><em>Commit Command<\/em><\/span><\/p>\n<pre class=\"brush:bash;\">git commit -m \"Message\"\n<\/pre>\n<p>This is used to commit the file to the local repository. Each commit needs a message to indicate the reason for the commit which is provided by the <code>-m<\/code> flag<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p><span style=\"text-decoration:underline\"><em>Push Command<\/em><\/span><\/p>\n<pre class=\"brush:bash;\">git push origin master\n<\/pre>\n<p>This is used to push our commits to the remote repository. A single commit contains multiple files and their changes. Once the commit is pushed, a success message gets displayed on the screen. Here, origin refers to the remote branch pointer while master is the remote branch.<\/p>\n<p><span style=\"text-decoration:underline\"><em>Pull Command<\/em><\/span><\/p>\n<pre class=\"brush:bash;\">git pull\n<\/pre>\n<p>Ideally, a git repository is used by multiple folks and can have commits at various intervals. In order to push our commits, We need to pull in the remote changes. This is done by the above command. The default execution of this does a merge operation which tries to merge the remote with our local and this is indicated by a merge commit.<\/p>\n<p>Alternatively, to maintain a linear history the <code>-r<\/code> flag is used which sequences the commits instead of a merge. Hence, there is no separate merge commit and local commits are added on top of remote commits indicating a linear history. This is called rebase.<\/p>\n<h2 class=\"wp-block-heading\">2. Git Patch<\/h2>\n<p>In this section, We will look at ways of creating patch file and how we can apply the patches. <\/p>\n<h2 class=\"wp-block-heading\">2.1 Git Patch Use cases<\/h2>\n<p>Generally the patch files generated are sent via email. They can be generated for a repository and applied to another. Most likely they will be applied in another branch. Another usecase is when the remote repository is undergoing outage, the commits can be passed via patch files to other developers.<\/p>\n<p><span id=\"code\"><\/span><\/p>\n<h2 class=\"wp-block-heading\">2.2 Git Patch Create<\/h2>\n<p>Let us initialize a new git repository by executing the following command in a new folder(test)<\/p>\n<pre class=\"brush:bash;\">cd test\ngit init<\/pre>\n<p>This creates an empty repository. Now lets add an empty file 1.txt to the folder and commit the file using the below command.<\/p>\n<pre class=\"brush:bash;\">git commit -m \"Initial commit\"<\/pre>\n<p>Now we can create a branch where we can apply the patch files. A new branch of the repository can be created by using the command<\/p>\n<pre class=\"brush:bash;\">git checkout -b branch1<\/pre>\n<p>The above command creates the branch and also navigates to the branch. We can see that empty file we created is present also in the branch. We can switch back to the original <code>master<\/code> branch using the command[ulp id=&#8217;pzgfvmZhgslwSymm&#8217;]<\/p>\n<pre class=\"brush:bash;\">git checkout master<\/pre>\n<p>In <code>master<\/code> branch, We will add content to the text file. We will add first hi to the text file and commit it. Then subsequently add hello to the text file and commit it. The final contents of the text file should be<\/p>\n<p><span style=\"text-decoration:underline\"><em>1.txt<\/em><\/span><\/p>\n<pre class=\"brush:bash;\">hi\nhello\n<\/pre>\n<p>Git also has a log command using which we can verify git history. After our series of commits git history must be similar to below<\/p>\n<p><span style=\"text-decoration:underline\"><em>Log Command<\/em><\/span><\/p>\n<pre class=\"brush:bash;\">git log --pretty=oneline\n<\/pre>\n<p>Generally, <code>git log<\/code> displays all the commit messages along with the changes. Appending the <code>oneline<\/code> flag displays only the commit messages. <\/p>\n<p><span style=\"text-decoration:underline\"><em>Displayed Log<\/em><\/span><\/p>\n<pre class=\"brush:bash;\">* ae92d22 (HEAD -&gt; master) Added hello\n* 33915bd Added hi\n* 423a8c8 Initial commit\n<\/pre>\n<p>Now we have added two commits on top of our original branch which is missing in the branch <code>branch1<\/code>. Now we can create patch files for importing in another repository.<\/p>\n<p><span style=\"text-decoration:underline\"><em>Patch Create Command<\/em><\/span><\/p>\n<pre class=\"brush:bash;\">git format-patch -2\n<\/pre>\n<p>This creates two patch files one for each commit respectively. Patch files are created in the same directory. If the patch files need to be created in a specified directory, this can be achieved by the below command.<\/p>\n<p><span style=\"text-decoration:underline\"><em>Patch Create Command<\/em><\/span><\/p>\n<pre class=\"brush:bash;\">git format-patch -2 -o &lt;dirname&gt;\n<\/pre>\n<p>The full path of the directory with the name must be specified in the above command. This creates the patch files in the specified directory.<\/p>\n<h2 class=\"wp-block-heading\">2.3 Git Apply Patch<\/h2>\n<p>To apply the patches, We have to navigate to the branch <code>branch1<\/code> using the checkout command. Once we are in branch1, we can apply the patch in two ways.<\/p>\n<p><span style=\"text-decoration:underline\"><em>Patch Apply with manual commit<\/em><\/span><\/p>\n<pre class=\"brush:bash;\">git apply 0001-Added-hi.patch\n<\/pre>\n<p>In this mode, the patch commit is applied but the files are neither staged nor committed. User has to manually commit the file after adding the file.<\/p>\n<p><span style=\"text-decoration:underline\"><em>Manual commit<\/em><\/span><\/p>\n<pre class=\"brush:bash;\">ga 1.txt\ngit commit -m \"Added hi as apply patch\"\n<\/pre>\n<p>Another approach is to apply the patch file as commit itself. This results in each patch generating a new commit on the target repository. We can achieve it by running the below command.<\/p>\n<p><span style=\"text-decoration:underline\"><em>Patch Apply as commit<\/em><\/span><\/p>\n<pre class=\"brush:bash;\">git am 0002-Added-hello.patch\n<\/pre>\n<p>Now we can verify the history of the branch by running the <code>git log<\/code> command. This should be similar as below.<\/p>\n<p><span style=\"text-decoration:underline\"><em>Displayed Log<\/em><\/span><\/p>\n<pre class=\"brush:bash;\">* 20b396e (HEAD -&gt; branch1) Added hello\n* 89a042d Added hi as apply patch\n* 6b1886b Commit 1\n<\/pre>\n<p>We can see the difference between the last two commit messages indicating the difference in how the patch was applied.<\/p>\n<h2 class=\"wp-block-heading\">3. Summary<\/h2>\n<p>In this post, we saw how to create a git patch and two ways of applying the git patch in another branch.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Introduction to Git In this post, we feature a comprehensive article on Git apply patch. Git is a distributed version control system for tracking changes in source code during software development. It is designed for coordinating work among programmers, but it can be used to track changes in any set of files. Its goals &hellip;<\/p>\n","protected":false},"author":148,"featured_media":27377,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1353],"tags":[1203],"class_list":["post-71848","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-git","tag-git"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Git apply patch Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Interested to learn more about Git? Then check out our detailed example on Git apply patch!\" \/>\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-apply-patch-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Git apply patch Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Interested to learn more about Git? Then check out our detailed example on Git apply patch!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-apply-patch-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=\"2019-06-10T08:00:58+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=\"Rajagopal ParthaSarathi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@PS_Rajagopal\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rajagopal ParthaSarathi\" \/>\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-apply-patch-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-apply-patch-example\/\"},\"author\":{\"name\":\"Rajagopal ParthaSarathi\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/c3c29bebb942f4a63a6a2d4c38411b85\"},\"headline\":\"Git apply patch Example\",\"datePublished\":\"2019-06-10T08:00:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-apply-patch-example\/\"},\"wordCount\":1068,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-apply-patch-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg\",\"keywords\":[\"git\"],\"articleSection\":[\"Git\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-apply-patch-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-apply-patch-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-apply-patch-example\/\",\"name\":\"Git apply patch Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-apply-patch-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-apply-patch-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg\",\"datePublished\":\"2019-06-10T08:00:58+00:00\",\"description\":\"Interested to learn more about Git? Then check out our detailed example on Git apply patch!\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-apply-patch-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-apply-patch-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-apply-patch-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-apply-patch-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 apply patch 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\/c3c29bebb942f4a63a6a2d4c38411b85\",\"name\":\"Rajagopal ParthaSarathi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cfb94a81445054c9121aae84e08c1e89caaae406739df92517996b0e41492b48?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cfb94a81445054c9121aae84e08c1e89caaae406739df92517996b0e41492b48?s=96&d=mm&r=g\",\"caption\":\"Rajagopal ParthaSarathi\"},\"description\":\"Rajagopal works in software industry solving enterprise-scale problems for customers across geographies specializing in distributed platforms. He holds a masters in computer science with focus on cloud computing from Illinois Institute of Technology. His current interests include data science and distributed computing.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/rajagopalparthasarathi\/\",\"https:\/\/x.com\/PS_Rajagopal\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/rajagopal-parthasarathi\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Git apply patch Example - Java Code Geeks","description":"Interested to learn more about Git? Then check out our detailed example on Git apply patch!","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-apply-patch-example\/","og_locale":"en_US","og_type":"article","og_title":"Git apply patch Example - Java Code Geeks","og_description":"Interested to learn more about Git? Then check out our detailed example on Git apply patch!","og_url":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-apply-patch-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2019-06-10T08:00:58+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":"Rajagopal ParthaSarathi","twitter_card":"summary_large_image","twitter_creator":"@PS_Rajagopal","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Rajagopal ParthaSarathi","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-apply-patch-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-apply-patch-example\/"},"author":{"name":"Rajagopal ParthaSarathi","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/c3c29bebb942f4a63a6a2d4c38411b85"},"headline":"Git apply patch Example","datePublished":"2019-06-10T08:00:58+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-apply-patch-example\/"},"wordCount":1068,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-apply-patch-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg","keywords":["git"],"articleSection":["Git"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-apply-patch-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-apply-patch-example\/","url":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-apply-patch-example\/","name":"Git apply patch Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-apply-patch-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-apply-patch-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg","datePublished":"2019-06-10T08:00:58+00:00","description":"Interested to learn more about Git? Then check out our detailed example on Git apply patch!","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-apply-patch-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-apply-patch-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-apply-patch-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-apply-patch-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 apply patch 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\/c3c29bebb942f4a63a6a2d4c38411b85","name":"Rajagopal ParthaSarathi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cfb94a81445054c9121aae84e08c1e89caaae406739df92517996b0e41492b48?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cfb94a81445054c9121aae84e08c1e89caaae406739df92517996b0e41492b48?s=96&d=mm&r=g","caption":"Rajagopal ParthaSarathi"},"description":"Rajagopal works in software industry solving enterprise-scale problems for customers across geographies specializing in distributed platforms. He holds a masters in computer science with focus on cloud computing from Illinois Institute of Technology. His current interests include data science and distributed computing.","sameAs":["https:\/\/www.linkedin.com\/in\/rajagopalparthasarathi\/","https:\/\/x.com\/PS_Rajagopal"],"url":"https:\/\/examples.javacodegeeks.com\/author\/rajagopal-parthasarathi\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/71848","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\/148"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=71848"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/71848\/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=71848"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=71848"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=71848"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}