{"id":1700,"date":"2021-12-27T06:29:49","date_gmt":"2021-12-27T12:29:49","guid":{"rendered":"https:\/\/www.becomebetterprogrammer.com\/?p=1700"},"modified":"2022-04-25T09:37:22","modified_gmt":"2022-04-25T14:37:22","slug":"git-head","status":"publish","type":"post","link":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/git-head\/","title":{"rendered":"What is Git HEAD? A Practical Guide Explained with Examples"},"content":{"rendered":"\n<p>There are chances you have been working with Git version control for a while and recently saw an article using the keyword <code>HEAD<\/code> after using a git command such as<a href=\"https:\/\/www.becomebetterprogrammer.com\/git-revert-last-commit\/\"> <code>revert<\/code> to rollback to the last commit after you unintentionally made a commit you were not intending to do<\/a>.<\/p>\n\n\n\n<p><strong>The HEAD in Git is a file that references the current branch you are currently on<\/strong>. Hence, if you are currently are in a <code>master<\/code> branch, the HEAD will have as a reference the master branch. If you checkout a different branch called <code>styles<\/code>, the HEAD reference will be updated to the <code>styles<\/code> branch.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\"><p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<\/div><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/git-head\/#Ways_to_see_the_HEAD_reference\" >Ways to see the HEAD reference<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/git-head\/#Using_the_symbolic-ref_command\" >Using the symbolic-ref command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/git-head\/#Using_the_log_command\" >Using the log command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/git-head\/#Reading_the_content_of_the_HEAD_file\" >Reading the content of the HEAD file<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/git-head\/#Example_of_using_the_HEAD\" >Example of using the HEAD<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/git-head\/#What_is_Git_HEAD_with_caret\" >What is Git HEAD^ (with caret)?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/git-head\/#What_is_Git_HEAD_with_tilde\" >What is Git HEAD~ (with tilde)?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/git-head\/#What_is_Git_HEAD_with_at_symbol\" >What is Git HEAD@{} (with at symbol)?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/git-head\/#Conclusion\" >Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/git-head\/#Interested_in_Learning_more_about_Git\" >Interested in Learning more about Git?<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Ways_to_see_the_HEAD_reference\"><\/span>Ways to see the HEAD reference<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Using_the_symbolic-ref_command\"><\/span>Using the <code>symbolic-ref<\/code> command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>There are different ways to verify the branch that HEAD is referencing. One option git documentation uses to read the value of the HEAD is to use the <code>symbolic-ref<\/code> command.<\/p>\n\n\n\n<pre class=\"wp-block-code language-git\"><code>git symbolic-ref HEAD<\/code><\/pre>\n\n\n\n<p>You should see a similar output to the following if you currently are in the <code>master<\/code> branch:<\/p>\n\n\n\n<p><code>refs\/heads\/master<\/code><\/p>\n\n\n\n<p>Let&#8217;s say we are going to checkout the <code>styles<\/code> to verify if the value of HEAD is updated.<\/p>\n\n\n\n<pre class=\"wp-block-code language-git\"><code>git checkout styles\ngit symbolic-ref HEAD<\/code><\/pre>\n\n\n\n<p>You should see the following output:<\/p>\n\n\n\n<p><code>refs\/heads\/styles<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Using_the_log_command\"><\/span>Using the <code>log<\/code> command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Another alternative to find the reference of HEAD is by using the <code>log<\/code> command and check the first commit record. It should show the HEAD pointer in the first output record displayed in the terminal. Feel free to include the <code>--oneline<\/code> config when using the <code>log<\/code> command if you don&#8217;t need to get additional information of commits such as the author and date of the commit.<\/p>\n\n\n\n<pre class=\"wp-block-code language-git\"><code>git log --oneline<\/code><\/pre>\n\n\n\n<p>Once you run the <code>log --oneline<\/code> command, you should a similar output like this:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"500\" src=\"https:\/\/www.becomebetterprogrammer.com\/wp-content\/uploads\/2021\/12\/Location-of-HEAD-using-git-log-1.png\" alt=\"\" class=\"wp-image-1704\" title=\"Location of HEAD using git log\" srcset=\"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-content\/uploads\/2021\/12\/Location-of-HEAD-using-git-log-1.png 800w, https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-content\/uploads\/2021\/12\/Location-of-HEAD-using-git-log-1-300x188.png 300w, https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-content\/uploads\/2021\/12\/Location-of-HEAD-using-git-log-1-768x480.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption>Location of HEAD using git log<\/figcaption><\/figure><\/div>\n\n\n\n<p>One disadvantage of this approach is the <code>log<\/code> command will show the log of every commit you have had in your repository, which might be too large and unnecessary to determine the branch HEAD is referencing.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Reading_the_content_of_the_HEAD_file\"><\/span>Reading the content of the HEAD file<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Knowing the HEAD file stores the reference of the current branch, we can read the file by manually opening the file or using the terminal.<\/p>\n\n\n\n<p>If you decide to open the HEAD file using the OS interface, you will find it inside the .git folder generated in the repository.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"500\" src=\"https:\/\/www.becomebetterprogrammer.com\/wp-content\/uploads\/2021\/12\/location-of-HEAD-file.png\" alt=\"\" class=\"wp-image-1702\" title=\"Location of HEAD file\" srcset=\"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-content\/uploads\/2021\/12\/location-of-HEAD-file.png 800w, https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-content\/uploads\/2021\/12\/location-of-HEAD-file-300x188.png 300w, https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-content\/uploads\/2021\/12\/location-of-HEAD-file-768x480.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption>Location of HEAD file<\/figcaption><\/figure><\/div>\n\n\n\n<p>On the other hand, if you rather check the content of the HEAD file using the terminal, make sure you open the terminal in the root of the folder and run the <code>cat<\/code> command to read the content of HEAD.<\/p>\n\n\n\n<pre class=\"wp-block-code language-git\"><code>cat .git\/HEAD<\/code><\/pre>\n\n\n\n<p>For instance, I had previously checked out the <code>styles<\/code> branch. Then, after running the <code>cat<\/code> command, this is the output my terminal shows.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"456\" height=\"90\" src=\"https:\/\/www.becomebetterprogrammer.com\/wp-content\/uploads\/2021\/12\/Location-of-HEAD-using-cat-command.png\" alt=\"\" class=\"wp-image-1705\" title=\"Location of HEAD using cat command\" srcset=\"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-content\/uploads\/2021\/12\/Location-of-HEAD-using-cat-command.png 456w, https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-content\/uploads\/2021\/12\/Location-of-HEAD-using-cat-command-300x59.png 300w\" sizes=\"auto, (max-width: 456px) 100vw, 456px\" \/><figcaption>Location of HEAD using cat command<\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Example_of_using_the_HEAD\"><\/span>Example of using the HEAD<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Luckily, we can use the HEAD when running other git commands. For instance, you can revert the last commit of your current branch in case you made a mistake or didn&#8217;t intend to commit changes using the <code>revert<\/code> command.<\/p>\n\n\n\n<pre class=\"wp-block-code language-git\"><code>git revert HEAD<\/code><\/pre>\n\n\n\n<p>In this case, using HEAD is convenient to reference the last commit of the current branch. Otherwise, you would need to get the SHA-1 or mechanism to identify commits in git, which you have probably seen in a 7-character id as the following id: <code>bbe9073<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_Git_HEAD_with_caret\"><\/span>What is Git HEAD^ (with caret)?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong>Git HEAD^ or git HEAD followed by a caret is a shorthand for git HEAD^1. Git HEAD^1 means the commit&#8217;s first parent<\/strong>. Hence, git HEAD^2 is the commit&#8217;s second parent.<\/p>\n\n\n\n<p>What does a commit&#8217;s parent mean?<\/p>\n\n\n\n<p>The concept of a commit&#8217;s parent is easier to understand if we have a branch merged into another branch as well as having a git tree diagram with the commits of each branch. For the following diagram, we are going to have two branches:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Master branch (green color)<\/li><li>Other_branch branch (yellow color)<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"500\" src=\"https:\/\/www.becomebetterprogrammer.com\/wp-content\/uploads\/2021\/12\/git-HEAD-with-caret.png\" alt=\"\" class=\"wp-image-1710\" title=\"Understanding git HEAD^ (with caret)\" srcset=\"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-content\/uploads\/2021\/12\/git-HEAD-with-caret.png 800w, https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-content\/uploads\/2021\/12\/git-HEAD-with-caret-300x188.png 300w, https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-content\/uploads\/2021\/12\/git-HEAD-with-caret-768x480.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption>Understanding git HEAD^ (with caret)<\/figcaption><\/figure><\/div>\n\n\n\n<p>We are currently in commit A in the master branch. Notice how commit E from the other_branch branch merged onto the master branch. Hence, commit A has two parent commits, B and E. Another way to visualize the parents is to remove one branch from the tree diagram.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"500\" src=\"https:\/\/www.becomebetterprogrammer.com\/wp-content\/uploads\/2021\/12\/Parents-of-commit-A.png\" alt=\"\" class=\"wp-image-1711\" title=\"Parents of commit A\" srcset=\"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-content\/uploads\/2021\/12\/Parents-of-commit-A.png 800w, https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-content\/uploads\/2021\/12\/Parents-of-commit-A-300x188.png 300w, https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-content\/uploads\/2021\/12\/Parents-of-commit-A-768x480.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption>Parents of commit A<\/figcaption><\/figure><\/div>\n\n\n\n<p>Therefore, in the master branch, commit A has a parent commit B. In the other_branch branch, commit E is the parent commit of A.<strong> A parent commit is the previous commit of a commit.<\/strong><\/p>\n\n\n\n<p>Whenever there is a merge into a branch, in our case, the master branch, the last commit of the branch merged onto will be the first parent commit. Therefore, if we are in commit A after merging into the master branch and we use HEAD^ or HEAD^1, we will get commit B.<\/p>\n\n\n\n<pre class=\"wp-block-code language-git\"><code>git show HEAD^ --oneline<\/code><\/pre>\n\n\n\n<p>Hence, the second parent is the left to the last commit of the &#8220;other_branch&#8221;  branch or commit E.<\/p>\n\n\n\n<pre class=\"wp-block-code language-git\"><code>git show HEAD^2 --oneline<\/code><\/pre>\n\n\n\n<p>Notice there are only two parents committed off of commit A. Hence, attempting to use HEAD^3 will lead to git throwing the following error:<\/p>\n\n\n\n<p><code>fatal: ambiguous argument 'HEAD^3': unknown revision or path not in the working tree<\/code><\/p>\n\n\n\n<p><code>Use '--' to separate paths from revisions, like this: 'git [\u2026] -- [\u2026]'<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_Git_HEAD_with_tilde\"><\/span>What is Git HEAD~ (with tilde)?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong>Git HEAD~ or git HEAD followed by a tilde is a shorthand for git HEAD~1. Git HEAD~1 means the previous commit of the last commit.<\/strong> Contrary to using the caret, git HEAD~ or HEAD with a tilde is simpler to understand as it references the previous commit of a specific branch. Another way to think about this is to go backward in a straightline. <\/p>\n\n\n\n<p>To understand this concept, we are going to take a look at the following diagram.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"500\" src=\"https:\/\/www.becomebetterprogrammer.com\/wp-content\/uploads\/2021\/12\/git-HEAD-with-tilde-1.png\" alt=\"\" class=\"wp-image-1713\" title=\"Undertstanding git HEAD~ (with tilde)\" srcset=\"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-content\/uploads\/2021\/12\/git-HEAD-with-tilde-1.png 800w, https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-content\/uploads\/2021\/12\/git-HEAD-with-tilde-1-300x188.png 300w, https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-content\/uploads\/2021\/12\/git-HEAD-with-tilde-1-768x480.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption><strong>Undertstanding git HEAD~ (with tilde)<\/strong><\/figcaption><\/figure><\/div>\n\n\n\n<p>In the previous diagram, notice the green color sequence of commits is the master branch. Hence, if we use the HEAD with the tilde we will have the following results:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>HEAD~ or HEAD~1 is commit B<\/li><\/ul>\n\n\n\n<ul class=\"wp-block-list\"><li>HEAD~2 is commit C<\/li><\/ul>\n\n\n\n<ul class=\"wp-block-list\"><li>HEAD~3 is commit D<\/li><\/ul>\n\n\n\n<p>Let&#8217;s say the HEAD is no longer in commit A, but instead in commit E in the &#8220;other_branch&#8221; branch. If we would want to get the reference of the previous commits using the HEAD with the tilde, we would get the following results:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>HEAD~ or HEAD~1 would be commit F<\/li><\/ul>\n\n\n\n<ul class=\"wp-block-list\"><li>HEAD~2 would be commit G<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_Git_HEAD_with_at_symbol\"><\/span>What is Git HEAD@{} (with at symbol)?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong>Git HEAD@{} or git HEAD followed by the at symbol and curly braces displays where the reference or HEAD was pointing at different times in the local repository.<\/strong> If you saw HEAD@{}, you probably used the <code>reflog<\/code> git command. The <code>reflog<\/code> shows the reference logs.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"919\" height=\"510\" src=\"https:\/\/www.becomebetterprogrammer.com\/wp-content\/uploads\/2021\/12\/git-HEAD@.png\" alt=\"\" class=\"wp-image-1715\" title=\"Reference logs using git reflog command\" srcset=\"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-content\/uploads\/2021\/12\/git-HEAD@.png 919w, https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-content\/uploads\/2021\/12\/git-HEAD@-300x166.png 300w, https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-content\/uploads\/2021\/12\/git-HEAD@-768x426.png 768w\" sizes=\"auto, (max-width: 919px) 100vw, 919px\" \/><figcaption>Reference logs using git reflog command<\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>All in all, the HEAD serves as a guide, pointer, or reference to tell the current branch we are working on. It is useful to learn what is the HEAD and all of its different variations such as using it with a caret (HEAD^), with a tilde (HEAD~), or with the at symbol and curly braces (HEAD@{}) in case you need to go back in history to checkout previous commits or revert the last commit.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Interested_in_Learning_more_about_Git\"><\/span>Interested in Learning more about Git?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>I wrote other articles explaining how to use other git commands, and I thought you might be interested in reading some of them since you are reading this.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/www.becomebetterprogrammer.com\/git-alias\/\">The Complete Guide to Git Alias: Shorcuts to Be Efficient<\/a><\/li><li><a href=\"https:\/\/www.becomebetterprogrammer.com\/git-revert-last-commit\/\">How to Revert to Last Commit Locally and Remote in Git<\/a><\/li><li><a href=\"https:\/\/www.becomebetterprogrammer.com\/git-rebase\/\">How to Rebase in Git: Explained Step-by-Step<\/a><\/li><li><a href=\"https:\/\/www.becomebetterprogrammer.com\/learn-how-to-use-version-control-with-git-and-github-the-absolute-guide-for-beginners\/\">Learn How to Use Version Control with Git and GitHub: The Absolute Guide for Beginners<\/a><\/li><li><a href=\"https:\/\/www.becomebetterprogrammer.com\/how-to-update-github-personal-access-tokens\/\">How to Update GitHub Personal Access Tokens?<\/a><\/li><\/ul>\n\n\n\n<p class=\"has-text-align-left\"><strong>Did you like this article?<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-left\">Share your thoughts by replying on <a href=\"https:\/\/twitter.com\/bbprogrammer\" target=\"_blank\" rel=\"noreferrer noopener\">Twitter of Become A Better Programmer<\/a> or to <a href=\"https:\/\/twitter.com\/arealesramirez\" target=\"_blank\" rel=\"noreferrer noopener\">personal my Twitter account<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-embed aligncenter is-type-rich is-provider-twitter wp-block-embed-twitter\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"twitter-tweet\" data-width=\"550\" data-dnt=\"true\"><p lang=\"en\" dir=\"ltr\">Are you telling me you don&#39;t know what is the meaning of HEAD?<br><br>No, I&#39;m not talking about your head.<br><br>I&#39;m talking about git HEAD.<br><br>In short: HEAD is a pointer or a reference to tell the current branch we are working on. Interested in more?<a href=\"https:\/\/t.co\/rkjiMK3dI9\">https:\/\/t.co\/rkjiMK3dI9<\/a><a href=\"https:\/\/twitter.com\/hashtag\/Git?src=hash&amp;ref_src=twsrc%5Etfw\" target=\"_blank\" rel=\"noopener\">#Git<\/a><\/p>&mdash; Become A Better Programmer (@bbprogrammer) <a href=\"https:\/\/twitter.com\/bbprogrammer\/status\/1475445976345231362?ref_src=twsrc%5Etfw\" target=\"_blank\" rel=\"noopener\">December 27, 2021<\/a><\/blockquote><script async src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>If you have used git version control, you probably have seen the keyword HEAD. This article explains everything you need to know about it.<\/p>\n","protected":false},"author":1,"featured_media":1721,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[28],"tags":[],"class_list":["post-1700","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-git","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50"],"_links":{"self":[{"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/posts\/1700","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/comments?post=1700"}],"version-history":[{"count":5,"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/posts\/1700\/revisions"}],"predecessor-version":[{"id":2470,"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/posts\/1700\/revisions\/2470"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/media\/1721"}],"wp:attachment":[{"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/media?parent=1700"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/categories?post=1700"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/tags?post=1700"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}