{"id":7,"date":"2024-07-01T10:17:35","date_gmt":"2024-07-01T10:17:35","guid":{"rendered":"http:\/\/mollimers.com\/?p=7"},"modified":"2024-07-01T14:58:40","modified_gmt":"2024-07-01T13:58:40","slug":"a-beginners-guide-to-git-file-versions-not-heaps-of-files","status":"publish","type":"post","link":"https:\/\/mollimers.com\/?p=7","title":{"rendered":"A Beginner&#8217;s Guide to Git: File versions, not heaps of files"},"content":{"rendered":"\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/mollimers.com\/wp-content\/uploads\/2024\/07\/dev_workflow_chaotic-1.png\" alt=\"\" class=\"wp-image-44\" srcset=\"https:\/\/mollimers.com\/wp-content\/uploads\/2024\/07\/dev_workflow_chaotic-1.png 1024w, https:\/\/mollimers.com\/wp-content\/uploads\/2024\/07\/dev_workflow_chaotic-1-300x300.png 300w, https:\/\/mollimers.com\/wp-content\/uploads\/2024\/07\/dev_workflow_chaotic-1-150x150.png 150w, https:\/\/mollimers.com\/wp-content\/uploads\/2024\/07\/dev_workflow_chaotic-1-768x768.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Introduction<\/h3>\n\n\n\n<p>Coding can be fun, challenging, and at times, hair-pullingly frustrating. No matter your state of mind while coding, you&#8217;ll often want to jump back and forth between alternative solutions\u2014whether to compare, find bugs, or simply figure out how that piece of code you copied from Stack Overflow is supposed to work.<\/p>\n\n\n\n<p>When first starting out it is quite common to go the route of a gazillion documents with similar names \u201c<em>test.cs<\/em>\u201d, \u201c<em>test_2.cs<\/em>\u201d, \u201c<em>final_test.cs<\/em>\u201d, \u201c<em>ok_now_it_should_work.cs<\/em>\u201d, \u201c<em>LKFJDGLKAJGLKAJ.cs<\/em>\u201d etc<\/p>\n\n\n\n<p>While this approach can work, it has many flaws. It\u2019s easy to get lost between the files and forget which file contained which solution. Moreover, sharing code among a group of developers is nearly impossible using this system.<\/p>\n\n\n\n<p>Enter Git!<\/p>\n\n\n\n<p>Git is a version control system that&#8217;s essential for managing code changes, collaborating with teammates, and maintaining the integrity of your projects. Think of Git as a time machine for your code\u2014allowing you to track, revert, and experiment without fear. On top of that, it lets you share code with others in smart and efficient ways.<\/p>\n\n\n\n<p>Let&#8217;s dive into the what, why, and how of Git to get you started on the right foot.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What is Git?<\/h3>\n\n\n\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Git\">Git<\/a> is a distributed version control system that lets you track changes to your files and coordinate work on those files among multiple people. It was created by Linus Torvalds in 2005 and has since become the de facto standard for version control in the software industry. Unlike centralized version control systems (VCS) that rely on a single server to store all versions of a project\u2019s files, Git allows every developer to have a complete copy of the repository. This makes it faster and more reliable, especially when working offline or in environments with unreliable network connectivity.<\/p>\n\n\n\n<p>There are <a href=\"https:\/\/en.wikipedia.org\/wiki\/Comparison_of_version-control_software\">other version control systems<\/a> you might encounter depending on your workplace or tech stack, but Git&#8217;s principles will help you adapt to any of them.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Why Use Git?<\/h4>\n\n\n\n<p>1. <strong>History and Backup<\/strong>: Git keeps a detailed history of changes, allowing you to revert to previous states if something goes wrong. Essentially, you create save points while coding, making it possible to load previous \u201csaves\u201d if necessary. Each save (commit) can contain changes to any number of files, so you don\u2019t have to remember which versions of different files go together.<\/p>\n\n\n\n<p>One of the beauties of Git (and all version control systems) is that Git only saves one version of each file and complements that with a history that records the changes. So, if you want two versions of a file with only one line different, you don&#8217;t create an entirely new file but instead keep the file and save the change to the history.<\/p>\n\n\n\n<p>2. <strong>Collaboration<\/strong>: Multiple developers can work on the same project simultaneously without overwriting each other&#8217;s changes. Each developer has a local repository containing all the project\u2019s files and their history. The team or project has one common central repository, commonly referred to as the remote repository, which is updated by individual developers when they want to share their work.<\/p>\n\n\n\n<p>3. <strong>Branching and Merging<\/strong>: Git&#8217;s branching model enables you to work on different features or bug fixes in isolation and merge them back into the main project when ready. Just as each developer has their own repository with a local history, a developer can set up multiple \u201cparallel histories,\u201d known as branches.<\/p>\n\n\n\n<p>Instead of making copies of all your files and putting them in a separate folder, Git allows you to create a new \u201chistory-file.\u201d Whenever you want, you can switch between branches, and Git will update your code based on that branch\u2019s history.&nbsp;<\/p>\n\n\n\n<p>Branches can be shared between developers using the central repository, facilitating collaboration on features or bug fixes. Developer 1 pushes (uploads) their local branch to the Remote (central) repository, developer 2 pulls (downloads) it to their local computer and now Dev 2 can do whatever they need to do on their machine without it affecting the code on Dev 1\u2019s computer.<\/p>\n\n\n\n<p>4. <strong>Experimentation<\/strong>: You can create branches to try out new ideas without affecting the stable codebase. Branches are commonly used for various purposes, including feature development, bug fixes, and experiments.<\/p>\n\n\n\n<p>A great benefit of branches for experimentation is that you can work with all the existing code without fear of breaking something for another developer or messing up what\u2019s currently in production. If the experiment doesn&#8217;t pan out, you can discard the branch and create a new one from the main branch (trunk).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How to Use Git<\/h3>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"679\" src=\"https:\/\/mollimers.com\/wp-content\/uploads\/2024\/07\/yancy-min-842ofHC6MaI-unsplash-1-1024x679.jpg\" alt=\"\" class=\"wp-image-45\" srcset=\"https:\/\/mollimers.com\/wp-content\/uploads\/2024\/07\/yancy-min-842ofHC6MaI-unsplash-1-1024x679.jpg 1024w, https:\/\/mollimers.com\/wp-content\/uploads\/2024\/07\/yancy-min-842ofHC6MaI-unsplash-1-300x199.jpg 300w, https:\/\/mollimers.com\/wp-content\/uploads\/2024\/07\/yancy-min-842ofHC6MaI-unsplash-1-768x509.jpg 768w, https:\/\/mollimers.com\/wp-content\/uploads\/2024\/07\/yancy-min-842ofHC6MaI-unsplash-1-1536x1018.jpg 1536w, https:\/\/mollimers.com\/wp-content\/uploads\/2024\/07\/yancy-min-842ofHC6MaI-unsplash-1-2048x1357.jpg 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>(Photo by <a href=\"https:\/\/unsplash.com\/photos\/a-close-up-of-a-text-description-on-a-computer-screen-842ofHC6MaI\">Yancy Min<\/a>)<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Basic Concepts<\/h4>\n\n\n\n<p>&#8211; <strong>Repository (Repo)<\/strong>: A Git repository is a directory that contains your project files and the entire history of their changes.<\/p>\n\n\n\n<p>&#8211; <strong>Commit<\/strong>: A snapshot of your project files at a particular point in time.<\/p>\n\n\n\n<p>&#8211; <strong>Branch<\/strong>: A parallel version of your project where you can make changes without affecting the main codebase (often called `main` or `master`, which is often considered the trunk of the \u201ccode tree\u201d).<\/p>\n\n\n\n<p>&#8211; <strong>Merge<\/strong>: Combining changes from one branch into another.<\/p>\n\n\n\n<p>&#8211; <strong>Remote<\/strong>: A version of your repository hosted on the internet or another network.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Getting Started with Git<\/h3>\n\n\n\n<p>1. <strong>Installing Git<\/strong>: If you haven&#8217;t already, download and install Git from [git-scm.com](https:\/\/git-scm.com\/).<\/p>\n\n\n\n<p>2. <strong>Setting Up Git<\/strong>: Configure your Git environment with your name and email.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git config --global user.name \"Your Name\"\n\ngit config --global user.email \"your.email@example.com\"<\/code><\/pre>\n\n\n\n<p>3. <strong>Initializing a Repository<\/strong>: Navigate to your project directory and initialize a Git repository.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git init<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Basic Git Commands<\/h4>\n\n\n\n<p>1. <strong>Clone a Repository<\/strong>: Copy an existing Git repository to your local machine.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git clone &lt;repository-url&gt;<\/code><\/pre>\n\n\n\n<p>2. <strong>Check Status<\/strong>: See the status of your working directory.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git status<\/code><\/pre>\n\n\n\n<p>3. **Add Changes**: Stage changes for the next commit.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git add &lt;file&gt;&nbsp; # Add a specific file<br><br>git add . &nbsp; &nbsp; &nbsp; # Add all changes<\/code><\/pre>\n\n\n\n<p>4. <strong>Commit Changes<\/strong>: Save your staged changes with a descriptive message.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git commit -m \"Add feature X\"<\/code><\/pre>\n\n\n\n<p>Alternatively, if you want to commit with title and description, simply use the -m flag two times:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git commit -m &lt;title&gt; -m &lt;description&gt;<\/code><\/pre>\n\n\n\n<p>If you wan your description to span multiple lines (e.g when making a list of changes) you can press enter before the second &#8220;.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git commit -m \"A big change\" \"1. My first change\n&gt; 2. My second change\n&gt; 3. My third change\"<\/code><\/pre>\n\n\n\n<p>The commit message won&#8217;t end until you add the closing quote. [Stack Overflow]<\/p>\n\n\n\n<p>5. <strong>Push Changes<\/strong>: Upload your local commits to a remote repository.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git push origin &lt;branch&gt;<\/code><\/pre>\n\n\n\n<p>6. <strong>Pull Changes<\/strong>: Fetch and merge changes from a remote repository.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git pull<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Visual Git Tools<\/h3>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/mollimers.com\/wp-content\/uploads\/2024\/07\/git-kraken.png\" alt=\"\" class=\"wp-image-48\" style=\"width:291px;height:auto\" srcset=\"https:\/\/mollimers.com\/wp-content\/uploads\/2024\/07\/git-kraken.png 1024w, https:\/\/mollimers.com\/wp-content\/uploads\/2024\/07\/git-kraken-300x300.png 300w, https:\/\/mollimers.com\/wp-content\/uploads\/2024\/07\/git-kraken-150x150.png 150w, https:\/\/mollimers.com\/wp-content\/uploads\/2024\/07\/git-kraken-768x768.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>While mastering Git commands in the terminal is invaluable, visual Git tools like GitKraken and GitHub Desktop can significantly streamline your workflow, especially when you&#8217;re getting started. GitKraken offers an intuitive interface with powerful features such as a visually appealing commit graph, drag-and-drop functionality for merging branches, and an integrated code editor, making it easier to manage complex repositories. On the other hand, GitHub Desktop provides a seamless experience for those who frequently use GitHub, with features like simple synchronization of local and remote repositories, straightforward conflict resolution, and easy access to pull requests and issues. These tools not only make Git more accessible but also enhance productivity by providing visual context to your version control processes. Whether you&#8217;re a novice or a seasoned developer, incorporating these tools can help you navigate Git&#8217;s complexities with greater ease and confidence.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Working with Branches<\/h3>\n\n\n\n<p>Branches are crucial for managing different lines of development. Here\u2019s how to think about them:<\/p>\n\n\n\n<p>&#8211; <strong>Main Branch<\/strong>: This is your stable production-ready branch.<\/p>\n\n\n\n<p>&#8211; <strong>Feature Branches<\/strong>: Create a new branch for each feature or bug fix.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git checkout -b &lt;feature-branch&gt;<\/code><\/pre>\n\n\n\n<p>&#8211; <strong>Merging Branches<\/strong>: Once your feature is complete, merge it back into the main branch.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git checkout main<br><br>git merge &lt;feature-branch&gt;<\/code><\/pre>\n\n\n\n<p>&#8211; <strong>Deleting Branches<\/strong>: After merging, you can delete the feature branch.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git branch -d &lt;feature-branch&gt;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Best Practices<\/h3>\n\n\n\n<p>1. <strong>Create a new branch for every feature, bug fix, experiment etc<\/strong>: By encapsulating each feature within its own branch it will be much easier to figure out what works and what doesn\u2019t. Avoid mixing multiple features, bug fixes etc within the same branch since it is harder to review by others and to debug if something goes wrong.<\/p>\n\n\n\n<p>2. <strong>Commit Often<\/strong>: Make small, frequent commits with clear messages. This makes it easier to track changes and identify issues.<\/p>\n\n\n\n<p>3. <strong>Write Good Commit Messages<\/strong>: A good commit message is concise yet descriptive. Use the format:<\/p>\n\n\n\n<p><strong>Short summary<\/strong> (50 characters or less)<\/p>\n\n\n\n<p><em>Detailed explanation<\/em> (if necessary, 72 characters per line)<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>4. <strong>Stay in Sync<\/strong>: Regularly pull changes from the remote repository to stay updated with your team\u2019s progress.<\/p>\n\n\n\n<p>5. <strong>Resolve Conflicts Promptly<\/strong>: If you encounter merge conflicts, address them as soon as possible to avoid complications.<\/p>\n\n\n\n<p>6. <strong>Review Code<\/strong>: Use pull requests or code reviews to ensure quality and consistency before merging changes into the main branch.<\/p>\n\n\n\n<p>7. <strong>Avoid Merge Conflicts<\/strong>: When working with a team of developers, try to work on different parts of the code base at any given time in order to avoid merge conflicts (they appear when you have made different changes to the same line of code).<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Collaborating with Others<\/h3>\n\n\n\n<p>When working with others, communication is key. Here are some tips for effective collaboration:<\/p>\n\n\n\n<p>&#8211; <strong>Use Pull Requests<\/strong>: These allow others to review your changes before they are merged.<\/p>\n\n\n\n<p>&#8211; <strong>Keep Your Branch Up-to-Date<\/strong>: Regularly rebase or merge the main branch into your feature branch to minimize conflicts.<\/p>\n\n\n\n<p>&#8211; <strong>Communicate<\/strong>: Let your team know what you\u2019re working on and if you need help.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Conclusion<\/h3>\n\n\n\n<p>Git might seem overwhelming at first, but with practice, it will become an invaluable part of your workflow. Remember, it&#8217;s not just about using Git commands but understanding the principles behind them. By following best practices and maintaining clear communication, you\u2019ll find that Git greatly enhances your ability to manage and collaborate on projects effectively.<\/p>\n\n\n\n<p>The article above might give you the impression that there are a bunch of rules and <em>A Correct Way Of Doing Things<\/em><sup>TM<\/sup> when it comes to Git and version control. The swell thing is that in most cases it is not such a big deal if you diverge from best practices! Commit messages can be amended (updated), if you put multiple features into the same branch you can try to break them apart, or simply learn from your mistakes and make future branches more focused.<\/p>\n\n\n\n<p>It is always better to try and fail than to not try at all for fear of angering highly opinionated people.<\/p>\n\n\n\n<p>So go forth and enjoy the fruits of the Git tree, because they are yummy!<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Further Reading<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Articles and Tutorials<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong><a href=\"https:\/\/www.atlassian.com\/git\/tutorials\">Atlassian Git Tutorial<\/a><\/strong>: A comprehensive guide covering Git basics, branching, merging, and advanced topics.<\/li>\n\n\n\n<li><strong><a href=\"http:\/\/rogerdudler.github.io\/git-guide\/\">Git &#8211; The Simple Guide<\/a><\/strong>: A concise, straightforward guide to getting started with Git.<\/li>\n\n\n\n<li><strong><a href=\"https:\/\/www.freecodecamp.org\/news\/how-to-write-better-git-commit-messages\/\">How to Write Better Git Commit Messages \u2013 A Step-By-Step Guide<\/a><\/strong>: A good primer with explanations and examples<\/li>\n\n\n\n<li><strong><a href=\"http:\/\/gitimmersion.com\/\">Git Immersion<\/a><\/strong>: A guided tour that walks you through the fundamentals of Git, with hands-on labs and examples.<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\">Free Ebooks<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong><a href=\"https:\/\/git-scm.com\/book\/en\/v2\">Pro Git<\/a><\/strong>: As mentioned, this is one of the best comprehensive resources available for free. Covers both basic and advanced Git concepts.<\/li>\n\n\n\n<li><strong><a href=\"https:\/\/www.git-tower.com\/learn\/ebook\/command-line\/\">Learn Version Control with Git<\/a><\/strong>: A free ebook by Tower, covering Git basics in an easy-to-understand format.<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\">Videos and Online Courses<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong><a href=\"https:\/\/www.udacity.com\/course\/version-control-with-git--ud123\">Udacity Git and GitHub Course<\/a><\/strong>: A free course that covers Git and GitHub essentials.<\/li>\n\n\n\n<li><strong><a href=\"https:\/\/guides.github.com\/\">GitHub Docs &amp; Guides<\/a><\/strong>: Official GitHub documentation, guides and tutorials to help you get started with GitHub.<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\">Cheat Sheets<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong><a href=\"https:\/\/education.github.com\/git-cheat-sheet-education.pdf\">Git Cheat Sheet by GitHub<\/a><\/strong>: A handy PDF covering essential Git commands and workflows.<\/li>\n\n\n\n<li><strong><a href=\"https:\/\/www.atlassian.com\/git\/tutorials\/atlassian-git-cheatsheet\">Atlassian Git Cheat Sheet<\/a><\/strong>: Another useful cheat sheet from Atlassian, providing a quick reference to common Git commands.<\/li>\n<\/ol>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Coding can be fun, challenging, and at times, hair-pullingly frustrating. No matter your state of mind while coding, you&#8217;ll often want to jump back and forth between alternative solutions\u2014whether to compare, find bugs, or simply figure out how that piece of code you copied from Stack Overflow is supposed to work. When first starting [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":44,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[5,3,4],"class_list":["post-7","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-coding","tag-coding","tag-git","tag-version-control"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>A Beginner&#039;s Guide to Git: File versions, not heaps of files - Mollimers<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/mollimers.com\/?p=7\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"A Beginner&#039;s Guide to Git: File versions, not heaps of files - Mollimers\" \/>\n<meta property=\"og:description\" content=\"Introduction Coding can be fun, challenging, and at times, hair-pullingly frustrating. No matter your state of mind while coding, you&#8217;ll often want to jump back and forth between alternative solutions\u2014whether to compare, find bugs, or simply figure out how that piece of code you copied from Stack Overflow is supposed to work. When first starting [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/mollimers.com\/?p=7\" \/>\n<meta property=\"og:site_name\" content=\"Mollimers\" \/>\n<meta property=\"article:published_time\" content=\"2024-07-01T10:17:35+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-01T13:58:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/mollimers.com\/wp-content\/uploads\/2024\/07\/dev_workflow_chaotic-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"mollimers\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"mollimers\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/mollimers.com\/?p=7#article\",\"isPartOf\":{\"@id\":\"https:\/\/mollimers.com\/?p=7\"},\"author\":{\"name\":\"mollimers\",\"@id\":\"https:\/\/mollimers.com\/#\/schema\/person\/6d752de0ce74f79bc33a3b0b86118950\"},\"headline\":\"A Beginner&#8217;s Guide to Git: File versions, not heaps of files\",\"datePublished\":\"2024-07-01T10:17:35+00:00\",\"dateModified\":\"2024-07-01T13:58:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/mollimers.com\/?p=7\"},\"wordCount\":1882,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/mollimers.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/mollimers.com\/?p=7#primaryimage\"},\"thumbnailUrl\":\"https:\/\/mollimers.com\/wp-content\/uploads\/2024\/07\/dev_workflow_chaotic-1.png\",\"keywords\":[\"coding\",\"git\",\"version control\"],\"articleSection\":[\"Coding\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/mollimers.com\/?p=7#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/mollimers.com\/?p=7\",\"url\":\"https:\/\/mollimers.com\/?p=7\",\"name\":\"A Beginner's Guide to Git: File versions, not heaps of files - Mollimers\",\"isPartOf\":{\"@id\":\"https:\/\/mollimers.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/mollimers.com\/?p=7#primaryimage\"},\"image\":{\"@id\":\"https:\/\/mollimers.com\/?p=7#primaryimage\"},\"thumbnailUrl\":\"https:\/\/mollimers.com\/wp-content\/uploads\/2024\/07\/dev_workflow_chaotic-1.png\",\"datePublished\":\"2024-07-01T10:17:35+00:00\",\"dateModified\":\"2024-07-01T13:58:40+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/mollimers.com\/?p=7#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/mollimers.com\/?p=7\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/mollimers.com\/?p=7#primaryimage\",\"url\":\"https:\/\/mollimers.com\/wp-content\/uploads\/2024\/07\/dev_workflow_chaotic-1.png\",\"contentUrl\":\"https:\/\/mollimers.com\/wp-content\/uploads\/2024\/07\/dev_workflow_chaotic-1.png\",\"width\":1024,\"height\":1024},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/mollimers.com\/?p=7#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/mollimers.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"A Beginner&#8217;s Guide to Git: File versions, not heaps of files\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/mollimers.com\/#website\",\"url\":\"https:\/\/mollimers.com\/\",\"name\":\"Mollimers\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/mollimers.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/mollimers.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/mollimers.com\/#organization\",\"name\":\"Mollimers\",\"url\":\"https:\/\/mollimers.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/mollimers.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/mollimers.com\/wp-content\/uploads\/2024\/07\/home-1.png\",\"contentUrl\":\"https:\/\/mollimers.com\/wp-content\/uploads\/2024\/07\/home-1.png\",\"width\":160,\"height\":158,\"caption\":\"Mollimers\"},\"image\":{\"@id\":\"https:\/\/mollimers.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/mollimers.com\/#\/schema\/person\/6d752de0ce74f79bc33a3b0b86118950\",\"name\":\"mollimers\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/mollimers.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/8a5c6f1d3e2376035ddc46e1889e933190b4a547667a53a130cc95eb0827ae46?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/8a5c6f1d3e2376035ddc46e1889e933190b4a547667a53a130cc95eb0827ae46?s=96&d=mm&r=g\",\"caption\":\"mollimers\"},\"sameAs\":[\"http:\/\/mollimers.com\"],\"url\":\"https:\/\/mollimers.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"A Beginner's Guide to Git: File versions, not heaps of files - Mollimers","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:\/\/mollimers.com\/?p=7","og_locale":"en_US","og_type":"article","og_title":"A Beginner's Guide to Git: File versions, not heaps of files - Mollimers","og_description":"Introduction Coding can be fun, challenging, and at times, hair-pullingly frustrating. No matter your state of mind while coding, you&#8217;ll often want to jump back and forth between alternative solutions\u2014whether to compare, find bugs, or simply figure out how that piece of code you copied from Stack Overflow is supposed to work. When first starting [&hellip;]","og_url":"https:\/\/mollimers.com\/?p=7","og_site_name":"Mollimers","article_published_time":"2024-07-01T10:17:35+00:00","article_modified_time":"2024-07-01T13:58:40+00:00","og_image":[{"width":1024,"height":1024,"url":"https:\/\/mollimers.com\/wp-content\/uploads\/2024\/07\/dev_workflow_chaotic-1.png","type":"image\/png"}],"author":"mollimers","twitter_card":"summary_large_image","twitter_misc":{"Written by":"mollimers","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/mollimers.com\/?p=7#article","isPartOf":{"@id":"https:\/\/mollimers.com\/?p=7"},"author":{"name":"mollimers","@id":"https:\/\/mollimers.com\/#\/schema\/person\/6d752de0ce74f79bc33a3b0b86118950"},"headline":"A Beginner&#8217;s Guide to Git: File versions, not heaps of files","datePublished":"2024-07-01T10:17:35+00:00","dateModified":"2024-07-01T13:58:40+00:00","mainEntityOfPage":{"@id":"https:\/\/mollimers.com\/?p=7"},"wordCount":1882,"commentCount":0,"publisher":{"@id":"https:\/\/mollimers.com\/#organization"},"image":{"@id":"https:\/\/mollimers.com\/?p=7#primaryimage"},"thumbnailUrl":"https:\/\/mollimers.com\/wp-content\/uploads\/2024\/07\/dev_workflow_chaotic-1.png","keywords":["coding","git","version control"],"articleSection":["Coding"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/mollimers.com\/?p=7#respond"]}]},{"@type":"WebPage","@id":"https:\/\/mollimers.com\/?p=7","url":"https:\/\/mollimers.com\/?p=7","name":"A Beginner's Guide to Git: File versions, not heaps of files - Mollimers","isPartOf":{"@id":"https:\/\/mollimers.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/mollimers.com\/?p=7#primaryimage"},"image":{"@id":"https:\/\/mollimers.com\/?p=7#primaryimage"},"thumbnailUrl":"https:\/\/mollimers.com\/wp-content\/uploads\/2024\/07\/dev_workflow_chaotic-1.png","datePublished":"2024-07-01T10:17:35+00:00","dateModified":"2024-07-01T13:58:40+00:00","breadcrumb":{"@id":"https:\/\/mollimers.com\/?p=7#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/mollimers.com\/?p=7"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/mollimers.com\/?p=7#primaryimage","url":"https:\/\/mollimers.com\/wp-content\/uploads\/2024\/07\/dev_workflow_chaotic-1.png","contentUrl":"https:\/\/mollimers.com\/wp-content\/uploads\/2024\/07\/dev_workflow_chaotic-1.png","width":1024,"height":1024},{"@type":"BreadcrumbList","@id":"https:\/\/mollimers.com\/?p=7#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/mollimers.com\/"},{"@type":"ListItem","position":2,"name":"A Beginner&#8217;s Guide to Git: File versions, not heaps of files"}]},{"@type":"WebSite","@id":"https:\/\/mollimers.com\/#website","url":"https:\/\/mollimers.com\/","name":"Mollimers","description":"","publisher":{"@id":"https:\/\/mollimers.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/mollimers.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/mollimers.com\/#organization","name":"Mollimers","url":"https:\/\/mollimers.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/mollimers.com\/#\/schema\/logo\/image\/","url":"https:\/\/mollimers.com\/wp-content\/uploads\/2024\/07\/home-1.png","contentUrl":"https:\/\/mollimers.com\/wp-content\/uploads\/2024\/07\/home-1.png","width":160,"height":158,"caption":"Mollimers"},"image":{"@id":"https:\/\/mollimers.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/mollimers.com\/#\/schema\/person\/6d752de0ce74f79bc33a3b0b86118950","name":"mollimers","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/mollimers.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/8a5c6f1d3e2376035ddc46e1889e933190b4a547667a53a130cc95eb0827ae46?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8a5c6f1d3e2376035ddc46e1889e933190b4a547667a53a130cc95eb0827ae46?s=96&d=mm&r=g","caption":"mollimers"},"sameAs":["http:\/\/mollimers.com"],"url":"https:\/\/mollimers.com\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/mollimers.com\/index.php?rest_route=\/wp\/v2\/posts\/7","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mollimers.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mollimers.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mollimers.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mollimers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7"}],"version-history":[{"count":4,"href":"https:\/\/mollimers.com\/index.php?rest_route=\/wp\/v2\/posts\/7\/revisions"}],"predecessor-version":[{"id":49,"href":"https:\/\/mollimers.com\/index.php?rest_route=\/wp\/v2\/posts\/7\/revisions\/49"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mollimers.com\/index.php?rest_route=\/wp\/v2\/media\/44"}],"wp:attachment":[{"href":"https:\/\/mollimers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mollimers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mollimers.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}