{"id":340,"date":"2021-07-28T14:50:22","date_gmt":"2021-07-28T21:50:22","guid":{"rendered":"https:\/\/bornski.com\/maria\/blog\/?p=340"},"modified":"2022-11-21T13:54:04","modified_gmt":"2022-11-21T21:54:04","slug":"demystifying-git-git-history-part-1","status":"publish","type":"post","link":"https:\/\/bornski.com\/maria\/blog\/2021\/07\/28\/demystifying-git-git-history-part-1\/","title":{"rendered":"Demystifying Git &#8211; Git History, Part 1"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Previous Installments<\/h2>\n\n\n\n<p>This post builds on information in <a href=\"https:\/\/bornski.com\/maria\/blog\/2021\/05\/01\/demystifying-git-git-commits\/\">Demystifying Git &#8211; Git Commits<\/a><\/p>\n\n\n\n<h1 class=\"wp-block-heading\">What is git history?<\/h1>\n\n\n\n<p>Git history is the record of what has happened in your git repository.<\/p>\n\n\n\n<p>As we learned in <a href=\"https:\/\/bornski.com\/maria\/blog\/2021\/05\/01\/demystifying-git-git-commits\/\">Demystifying Git &#8211; Git Commits<\/a>, each commit object stores information about who, what, and when for that commit object AND the commit ID(s) of any parent commits.   Git history, therefore, is the who, what, and when for each commit AND the relationships between each commit and the prior commit(s). <\/p>\n\n\n\n<p>Because we already covered the who, what, and when information in  <a href=\"https:\/\/bornski.com\/maria\/blog\/2021\/05\/01\/demystifying-git-git-commits\/\">Demystifying Git &#8211; Git Commits<\/a>, here we&#8217;ll dive into the relationships between each commit and the prior commit(s).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Mathematical Concepts &amp; Data Structures<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Directed Acyclic Graph<\/h3>\n\n\n\n<p>Git history is a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Directed_acyclic_graph\">directed, acyclic graph<\/a> (DAG) where each commit is a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Vertex_(graph_theory)\">vertex<\/a> and the relationship from a commit to its parent commit(s) form the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Glossary_of_graph_theory#edge\">edges<\/a>.<\/p>\n\n\n\n<p>The relationship between two directly connected git commits is inherently <strong>directed<\/strong> because one commit is the parent commit and one commit is the child commit &#8212; We can&#8217;t flip that relationship and come out with the same history graph.  <\/p>\n\n\n\n<p>Additionally, our git history graph is <strong>acyclic<\/strong> &#8212; Because the list of parent commit ID(s) is included in the information that git hashes to create each commit ID, a commit can not be its own ancestor. Its commit ID does not exist yet and so can not have been stored as a parent commit already.  <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Similarity to Linked Lists<\/h3>\n\n\n\n<p>Because commits may have multiple parents, git history is not really a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Linked_list\">linked list<\/a>.  If visualizing git history as a graph makes sense to you, ignore this section &#8212; git history is a graph, so you&#8217;re good go go!<\/p>\n\n\n\n<p>If, however, you&#8217;re a bit confused by graphs but linked lists make sense to you, you can use your knowledge of linked lists to think about git history.  Taking the list of parent commit ID(s) as link(s) to previous nodes, traversing git history is conceptually similar to traversing one or more linked lists.  A commit with a single parent commit links to a single linked list.  A commit with multiple parent commits links to multiple linked lists instead of just one.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Viewing git history<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">Viewing commit lists or changes only<\/h2>\n\n\n\n<p><code>git log<\/code> is the command you&#8217;ll use most frequently to view lists of git commits.  <\/p>\n\n\n\n<p>We can use <code>git log<\/code> to view slightly different information about the same history.   The default  <code>git log<\/code> output shows CommitIDs, Author, AuthorDate, and commit messages.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-log.png\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"512\" src=\"https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-log-1024x512.png\" alt=\"Screenshot of output for &quot;git log&quot; from https:\/\/github.com\/mariabornski\/demystifying-git-examples with ec74f00266db as the HEAD commit\" class=\"wp-image-343\" srcset=\"https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-log-1024x512.png 1024w, https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-log-300x150.png 300w, https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-log-768x384.png 768w, https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-log.png 1481w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><figcaption>Command: &#8220;<code>git log<\/code>&#8220;<\/figcaption><\/figure>\n\n\n\n<p>If we want to see just commit IDs and the first line of each commit message, we can use <code>git log --pretty=oneline<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-log-pretty-oneline.png\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"107\" src=\"https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-log-pretty-oneline-1024x107.png\" alt=\"Screenshot of output for &quot;git log --pretty=oneline&quot; from https:\/\/github.com\/mariabornski\/demystifying-git-examples with ec74f00266db as the HEAD commit\" class=\"wp-image-344\" srcset=\"https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-log-pretty-oneline-1024x107.png 1024w, https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-log-pretty-oneline-300x31.png 300w, https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-log-pretty-oneline-768x81.png 768w, https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-log-pretty-oneline.png 1477w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><figcaption>Command: &#8220;<code>git log --pretty=oneline<\/code>&#8220;<\/figcaption><\/figure>\n\n\n\n<p>I frequently want to see both Author and Committer information, plus what actually changed in the commit, so I use <code>git log -p --pretty=fuller<\/code> frequently:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-log-p-pretty-fuller.png\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"512\" src=\"https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-log-p-pretty-fuller-1024x512.png\" alt=\"Screenshot of output for &quot;git log -p --pretty=fuller&quot; from https:\/\/github.com\/mariabornski\/demystifying-git-examples with ec74f00266db as the HEAD commit\" class=\"wp-image-345\" srcset=\"https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-log-p-pretty-fuller-1024x512.png 1024w, https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-log-p-pretty-fuller-300x150.png 300w, https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-log-p-pretty-fuller-768x384.png 768w, https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-log-p-pretty-fuller.png 1477w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><figcaption>Command: &#8220;<code>git log -p --pretty=oneline<\/code>&#8220;<\/figcaption><\/figure>\n\n\n\n<p>If you&#8217;d like to learn more about ways of viewing git commits, the &#8220;<a href=\"https:\/\/git-scm.com\/book\/en\/v2\/Git-Basics-Viewing-the-Commit-History\">Git Basics &#8211; Viewing the Commit History<\/a>&#8221; chapter of &#8220;ProGit&#8221; has a good introduction to the <code>git log<\/code> command, as do many other online tutorials.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Viewing the git history graph<\/h2>\n\n\n\n<h4 class=\"wp-block-heading\">git log<\/h4>\n\n\n\n<p>You can use <code>git log<\/code> to view the git history graph!  By adding <code>--all<\/code> and <code>--graph<\/code> to our previous <code>git log --pretty=oneline<\/code> command, we can see a representation of the history graph for our entire repository:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-log-pretty-oneline-all-graph.png\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"145\" src=\"https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-log-pretty-oneline-all-graph-1024x145.png\" alt=\"\" class=\"wp-image-348\" srcset=\"https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-log-pretty-oneline-all-graph-1024x145.png 1024w, https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-log-pretty-oneline-all-graph-300x43.png 300w, https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-log-pretty-oneline-all-graph-768x109.png 768w, https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-log-pretty-oneline-all-graph.png 1481w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><figcaption>Viewing our git history graph in the terminal!<br>Command: <code>git log --pretty=oneline --all --graph<\/code><\/figcaption><\/figure>\n\n\n\n<p>This view may get hard to follow as our repository gets bigger, but it&#8217;s a useful option if you don&#8217;t have any other tools for viewing the history graph.  You can include <code>--graph<\/code> on any <code>git log<\/code> command, but the longer your output for each commit, the harder the graph will be to follow.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">gitk<\/h4>\n\n\n\n<p>In the past, I&#8217;ve often used <a href=\"https:\/\/git-scm.com\/docs\/gitk\/\">gitk<\/a> for viewing the git history graph.  However, I&#8217;m writing this post using Windows Subsystem for Linux, so I&#8217;m not going to go down the rabbit hole of getting a Linux graphical program to work on WSL. <\/p>\n\n\n\n<h4 class=\"wp-block-heading\">GitHub<\/h4>\n\n\n\n<p>For a site built around git, GitHub sure makes it hard to view the history graph!<\/p>\n\n\n\n<p>After some poking around, it looks like the &#8220;Network&#8221; view under the &#8220;Insights&#8221; tab has the right information.  Here&#8217;s the <a href=\"https:\/\/github.com\/mariabornski\/demystifying-git-examples\/network\">network view<\/a> for our demystifying-git-examples repository as it was after <a href=\"https:\/\/bornski.com\/maria\/blog\/2021\/05\/01\/demystifying-git-git-commits\/\">Demystifying Git &#8211; Git Commits<\/a>:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/github-network-graph-view-demystifying-git-examples-after-commits-post.png\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"504\" src=\"https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/github-network-graph-view-demystifying-git-examples-after-commits-post-1024x504.png\" alt=\"\" class=\"wp-image-347\" srcset=\"https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/github-network-graph-view-demystifying-git-examples-after-commits-post-1024x504.png 1024w, https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/github-network-graph-view-demystifying-git-examples-after-commits-post-300x148.png 300w, https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/github-network-graph-view-demystifying-git-examples-after-commits-post-768x378.png 768w, https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/github-network-graph-view-demystifying-git-examples-after-commits-post.png 1152w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><figcaption>Network Graph view on GitHub for demystifying-git-examples<\/figcaption><\/figure>\n\n\n\n<p>Note that right after <a href=\"https:\/\/bornski.com\/maria\/blog\/2021\/05\/01\/demystifying-git-git-commits\/\">Demystifying Git &#8211; Git Commits<\/a> , our history graph is pretty simple &#8212; only 2 branches and no merge commits.  As we build up this repository with more examples, the history graph will get more complicated<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Creating custom git history graphs with graphviz<\/h4>\n\n\n\n<p>As I worked on this post, I did not find any &#8220;out of the box&#8221; solutions that let me show just the git history graph of a repository in an easy to understand way.  I did, however, find a <a href=\"https:\/\/git.wiki.kernel.org\/index.php\/Aliases#Use_graphviz_for_display\">git alias example<\/a> that formats git log output into a format that <a href=\"https:\/\/graphviz.org\/\">graphviz<\/a> can understand.  A lot of fighting with sed, awk, and escaping characters later &amp; I&#8217;ve added a <a href=\"https:\/\/github.com\/mariabornski\/demystifying-git-examples\/blob\/0148822ffe5b02b789d8c9db443d5d2d3786821c\/.gitconfig\" data-type=\"URL\" data-id=\"https:\/\/github.com\/mariabornski\/demystifying-git-examples\/blob\/0148822ffe5b02b789d8c9db443d5d2d3786821c\/.gitconfig\">.gitconfig into demystifying-git-examples<\/a> that will let me generate graphviz compatible output directly from <a href=\"https:\/\/github.com\/mariabornski\/demystifying-git-examples\">demystifying-git-examples<\/a>!<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/demo-different-commit-ids-graph.png\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"126\" src=\"https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/demo-different-commit-ids-graph-1024x126.png\" alt=\"\" class=\"wp-image-351\" srcset=\"https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/demo-different-commit-ids-graph-1024x126.png 1024w, https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/demo-different-commit-ids-graph-300x37.png 300w, https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/demo-different-commit-ids-graph-768x95.png 768w, https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/demo-different-commit-ids-graph.png 1062w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><figcaption>git history graph for <em>demo-different-commit-ids<\/em> branch in <em>demystifying-git-examples<\/em><\/figcaption><\/figure>\n\n\n\n<p>Now that&#8217;s a beautiful history graph!!<\/p>\n\n\n\n<p>Unless I make more tweaks, I&#8217;ll be using the version of the graphviz git alias from commit  <code>0148822ff<\/code> of <a href=\"https:\/\/github.com\/mariabornski\/demystifying-git-examples\/blob\/0148822ffe5b02b789d8c9db443d5d2d3786821c\/.gitconfig\">demystifying-git-examples<\/a>.  git won&#8217;t automatically pick up the checked in .gitconfig, but you can tell git to use it by running the following from within your local copy of demystifying-git-examples:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git config --local include.path ..\/.gitconfig<\/code><\/pre>\n\n\n\n<p>Note that this does mean that if you check out a commit within demystifying-git-examples that does not contain this .gitconfig file, or has a different version of it, you&#8217;ll get different results from the git aliases.  You may, therefore, instead want to copy\/paste the git aliases into your global .gitconfig.<\/p>\n\n\n\n<p>Once you&#8217;ve pointed git at the aliases that convert history into graphviz format, you can output the graphviz format from your history by running <code>git graphviz &lt;any other options you'd pass to git log&gt;<\/code> :<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-graphviz-demo-different-commit-ids.png\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"370\" src=\"https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-graphviz-demo-different-commit-ids-1024x370.png\" alt=\"\" class=\"wp-image-353\" srcset=\"https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-graphviz-demo-different-commit-ids-1024x370.png 1024w, https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-graphviz-demo-different-commit-ids-300x108.png 300w, https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-graphviz-demo-different-commit-ids-768x277.png 768w, https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-graphviz-demo-different-commit-ids.png 1072w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><figcaption>command: &#8220;<code>git graphviz demo-different-commit-ids<\/code>&#8220;<\/figcaption><\/figure>\n\n\n\n<p> I&#8217;ve set up the default output to include branch names in the graph, but if you don&#8217;t want that, you can use <code>git graphviz-no-branches<\/code> instead:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-graphviz-no-branches-demo-different-commit-ids.png\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"210\" src=\"https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-graphviz-no-branches-demo-different-commit-ids-1024x210.png\" alt=\"\" class=\"wp-image-354\" srcset=\"https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-graphviz-no-branches-demo-different-commit-ids-1024x210.png 1024w, https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-graphviz-no-branches-demo-different-commit-ids-300x62.png 300w, https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-graphviz-no-branches-demo-different-commit-ids-768x158.png 768w, https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-graphviz-no-branches-demo-different-commit-ids.png 1072w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><figcaption>command: &#8221; <code>git graphviz-no-branches demo-different-commit-ids<\/code> &#8220;<\/figcaption><\/figure>\n\n\n\n<p>The real magic comes when you covert this to an image.  I&#8217;m using the <code>dot<\/code> CLI tool, which I installed as part of graphviz via <code>sudo apt-get install graphviz<\/code>. By piping our git graphviz output to dot, we can create an image file of our git history:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-graphviz-demo-different-commit-ids-pipe-dot.png\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"49\" src=\"https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-graphviz-demo-different-commit-ids-pipe-dot-1024x49.png\" alt=\"\" class=\"wp-image-355\" srcset=\"https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-graphviz-demo-different-commit-ids-pipe-dot-1024x49.png 1024w, https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-graphviz-demo-different-commit-ids-pipe-dot-300x14.png 300w, https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-graphviz-demo-different-commit-ids-pipe-dot-768x37.png 768w, https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/git-graphviz-demo-different-commit-ids-pipe-dot.png 1080w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><figcaption>command: &#8221; <code>git graphviz demo-different-commit-ids | dot -Tpng -o demo-different-commit-ids-graph.png <\/code>&#8220;<\/figcaption><\/figure>\n\n\n\n<p>And there we go, our git history graph I showed above:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/demo-different-commit-ids-graph.png\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"126\" src=\"https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/demo-different-commit-ids-graph-1024x126.png\" alt=\"\" class=\"wp-image-351\" srcset=\"https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/demo-different-commit-ids-graph-1024x126.png 1024w, https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/demo-different-commit-ids-graph-300x37.png 300w, https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/demo-different-commit-ids-graph-768x95.png 768w, https:\/\/bornski.com\/maria\/blog\/wp-content\/uploads\/2021\/07\/demo-different-commit-ids-graph.png 1062w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><figcaption> git history graph for <em>demo-different-commit-ids<\/em> branch in <em>demystifying-git-examples<\/em><\/figcaption><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\">Coming in Git History, Part 2<\/h1>\n\n\n\n<p>I originally intended this to be a single post, but this got long!  In Git History, Part 2, we&#8217;ll talk about how to navigate the git history graph to figure out what has happened in your repository!<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Try it for yourself!<\/h1>\n\n\n\n<p>All examples on this post were created using&nbsp;<a href=\"https:\/\/github.com\/mariabornski\/demystifying-git-examples\">https:\/\/github.com\/mariabornski\/demystifying-git-examples<\/a>, &nbsp;<code>git version 2.25.1<\/code>, and <code>dot - graphviz version 2.43.0 (0)<\/code>&nbsp;on&nbsp;<code>Ubuntu 20.04.1 LTS (GNU\/Linux 4.19.128-microsoft-standard x86_64<\/code>).<\/p>\n\n\n\n<p>You\u2019re welcome to go clone the repository yourself &amp; try out the commands! Similar commands will work on any git repository, you\u2019ll just need to substitute your own commit IDs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Previous Installments This post builds on information in Demystifying Git &#8211; Git Commits What is git history? Git history is the record of what has happened in your git repository. As we learned in Demystifying Git &#8211; Git Commits, each commit object stores information about who, what, and when for that commit object AND the &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/bornski.com\/maria\/blog\/2021\/07\/28\/demystifying-git-git-history-part-1\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Demystifying Git &#8211; Git History, Part 1&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[39,28],"tags":[40,34],"_links":{"self":[{"href":"https:\/\/bornski.com\/maria\/blog\/wp-json\/wp\/v2\/posts\/340"}],"collection":[{"href":"https:\/\/bornski.com\/maria\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bornski.com\/maria\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bornski.com\/maria\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bornski.com\/maria\/blog\/wp-json\/wp\/v2\/comments?post=340"}],"version-history":[{"count":9,"href":"https:\/\/bornski.com\/maria\/blog\/wp-json\/wp\/v2\/posts\/340\/revisions"}],"predecessor-version":[{"id":360,"href":"https:\/\/bornski.com\/maria\/blog\/wp-json\/wp\/v2\/posts\/340\/revisions\/360"}],"wp:attachment":[{"href":"https:\/\/bornski.com\/maria\/blog\/wp-json\/wp\/v2\/media?parent=340"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bornski.com\/maria\/blog\/wp-json\/wp\/v2\/categories?post=340"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bornski.com\/maria\/blog\/wp-json\/wp\/v2\/tags?post=340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}