{"id":17382,"date":"2017-11-15T13:30:49","date_gmt":"2017-11-15T13:30:49","guid":{"rendered":"https:\/\/www.heartinternet.uk\/blog\/?p=17382"},"modified":"2017-11-15T13:30:49","modified_gmt":"2017-11-15T13:30:49","slug":"mastering-git","status":"publish","type":"post","link":"https:\/\/www.heartinternet.uk\/blog\/mastering-git\/","title":{"rendered":"Mastering Git"},"content":{"rendered":"<p>Writing code and managing a good workflow is a challenge. Things can easily get messy, and bugs can appear from seemingly nowhere. This is where Git comes in. No matter who you are, or how much code you write on a daily basis, using Git will change your workflow and coding behaviour for the better and make collaboration in teams possible.<\/p>\n<p>Do you have problems such as obscure file names (eg final, final2, final3)? Do you struggle to tell what&#8217;s changed between versions of designs, files or code? Do you ever make changes to a file and then struggle to return to a previous point in the workflow? Version control can help you solve all of these problems.<\/p>\n<p>Git is a version control system. It allows for every change in your projects to get tracked, every line of code added or removed. So when you work on the new <em>feature\/redesign-navigation<\/em> and make it worse, you can roll back to a point when it was working \u2014 or easily hand it off to someone who knows how to fix the problem. It can even be used for image files, you don&#8217;t necessarily get a pretty overview of what&#8217;s changed on most Git platforms, but you&#8217;re still able to commit changes to your designs.<\/p>\n<p>Git takes snapshots of your work that live in a project called a repository, also known as a repo. The snapshots make up a history of every change you save. You make these snapshots by committing changes. The commit is the most important part of Git, as it&#8217;s the way to save changed or new files to the history. Each commit you make gets a message, and it&#8217;s important to always write a message so you know what&#8217;s changed. The committing mindset is powerful, because it lets you think about your code (or design) in a modular way, helping you to organise your work in a pragmatic manner.<\/p>\n<p>You might have heard of something called <a href=\"https:\/\/github.com\/\" target=\"_blank\">GitHub<\/a>. GitHub isn&#8217;t Git, it&#8217;s just a platform for the Git repository. Normally you&#8217;d have to install Git on a server and then manage it, but tools were invented to prevent you from having to do this. GitHub is one of them, others are <a href=\"https:\/\/bitbucket.org\/\" target=\"_blank\">BitBucket<\/a> and <a href=\"https:\/\/about.gitlab.com\/\" target=\"_blank\">GitLab<\/a>.<\/p>\n<h3>Getting started<\/h3>\n<p>The best way to learn about Git is to do it yourself, so start by creating a <a href=\"https:\/\/github.com\/\" target=\"_blank\">GitHub account<\/a>. Then create a new repository, you can name it whatever you like.<\/p>\n<p align=\"center\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/masteringgit-newrepository.jpg\" alt=\"Creating a new repository in GitHub\" width=\"650\" height=\"497\" class=\"aligncenter size-full wp-image-17403\" \/><\/p>\n<p>You might have seen someone use Git from the terminal or command line. This is quite easy to do, but for our example, let&#8217;s use a UI \u2014 the <a href=\"https:\/\/desktop.github.com\/\" target=\"_blank\">GitHub Desktop App<\/a> for Windows and macOS.<\/p>\n<p>You now need to clone the repository you just created. Go to \u2018File > Clone Repository\u2026\u2019 and select your repository. You&#8217;ll be asked to select a folder, this is where the project will be stored on your computer.<\/p>\n<p align=\"center\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/masteringgit-clonerepository.jpg\" alt=\"Cloning a repository in GitHub\" width=\"650\" height=\"708\" class=\"aligncenter size-full wp-image-17405\" \/><\/p>\n<p>You can now save some changes to your repo. Add any file, and you&#8217;ll see the changes in the GitHub App.<\/p>\n<p align=\"center\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/masteringgit-addfile.jpg\" alt=\"Adding a file to your GitHub repository\" width=\"650\" height=\"133\" class=\"aligncenter size-full wp-image-17407\" \/><\/p>\n<p>So now we&#8217;ll add a message, and commit it. The best practice for commit messages is to use present participle tense \u2014 or like you\u2019d read in a cookbook:. \u201cAdd 250g of flour\u201d (or \u201cadd styling for about page\u201d).<\/p>\n<p align=\"center\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/masteringgit-initialcommit.jpg\" alt=\"Adding a message for your commit\" width=\"500\" height=\"388\" class=\"aligncenter size-full wp-image-17409\" \/><\/p>\n<p>When you&#8217;re ready to share your code, it&#8217;s important to push your changes using the \u2018publish\u2019 button, so other people can see them (and so your code is backed up somewhere). And then to get other people&#8217;s changes, you should pull their changes by using the \u2018fetch origin\u2019 button.<\/p>\n<p>You&#8217;ll now have a snapshot of your code history saved, and you&#8217;ll be able to see this in the history tab of the GitHub app. Your repo is now also shareable. If you go to your GitHub profile, you&#8217;ll be able to see the repository and the file(s) you just added.<\/p>\n<p align=\"center\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/masteringgit-gitdemo.jpg\" alt=\"Your GitHub profile and the repository you created\" width=\"650\" height=\"292\" class=\"aligncenter size-full wp-image-17393\" \/><\/p>\n<p>Congratulations! You&#8217;re now able to use Git to improve your workflow. That wasn&#8217;t so hard, was it?<\/p>\n<h3>Better collaboration<\/h3>\n<p>When you\u2019re collaborating with a friend or a colleague on a project, things can get messy if you don\u2019t keep things organised. If you use the project, and then someone else pushes, you won\u2019t be able to push your changes until you\u2019ve pulled and \u2018rebased\u2019 or \u2018merged\u2019 the changes. This isn\u2019t the ideal way to use Git.<\/p>\n<p>Git works in a tree like structure. The main element of the project is the \u2018master\u2019 or the trunk of a tree. You can create a branch of the tree, work on a specific feature or bug fix on that branch, and then merge it back into master. Let\u2019s try this now.<\/p>\n<p>To create a new branch, go to the branch menu item, between repository and window. Click \u2018new branch\u2019 and name it along the lines of what you\u2019re about to do. If it\u2019s a feature, prefix it with <code>feature\/<\/code>. If it\u2019s a bug fix, prefix it with <code>fix\/<\/code>.<\/p>\n<p align=\"center\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/masteringgit-createbranch.jpg\" alt=\"Creating a new branch in GitHub\" width=\"650\" height=\"451\" class=\"aligncenter size-full wp-image-17395\" \/><\/p>\n<p>As before, create a new file with some text and commit and publish your changes.<\/p>\n<p>If you now look at your project in Finder \/ Windows Viewer,  you\u2019ll see your two files.<\/p>\n<p align=\"center\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/masteringgit-windowsviewer.jpg\" alt=\"The two files in your Windows Viewer\" width=\"650\" height=\"224\" class=\"aligncenter size-full wp-image-17397\" \/><\/p>\n<p>Going back to the GitHub app, click the tab that says \u2018current branch\u2019 and then your branch name, and then select \u2018master\u2019. This is called a \u2018checkout\u2019.<\/p>\n<p>If you look at your file viewer again, you won\u2019t see the new file you just added to the <code>feature\/add-new-file<\/code> branch. This is how branches help to solve issues with collaboration and file management.<\/p>\n<p>When you\u2019ve finished your work, you\u2019re going to want to have them in the master of the project. We need to do this in the GitHub web interface.<\/p>\n<p>Open your project at github.com, and then click the branches tab.<\/p>\n<p align=\"center\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/masteringgit-masterfile.jpg\" alt=\"The new branches in your GitHub repository\" width=\"650\" height=\"308\" class=\"aligncenter size-full wp-image-17399\" \/><\/p>\n<p>Next to your new branch, there\u2019s a \u2018new pull request\u2019 button. Let\u2019s click this. This new view includes all the information you need to see the changes you made between your new branch and master. You can add a pull request message, and set an assignee to approve the pull request which is a good idea if you\u2019re working on a project with other people. When you\u2019ve filled in all the information you feel is necessary for people to properly review your pull request, click the \u2018create pull request\u2019 button.<\/p>\n<p>You\u2019ll be taken to a new view, and have the option to merge the pull request. Let\u2019s do this. You should now also delete the branch.<\/p>\n<p align=\"center\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/masteringgit-pullrequest.jpg\" alt=\"A successful pull request in GitHub\" width=\"650\" height=\"99\" class=\"aligncenter size-full wp-image-17401\" \/><\/p>\n<p>If you go back into the GitHub app, change your branch to master and then fetch origin. You\u2019ll see the merge request in the history tab.<\/p>\n<h3>Issue tracking<\/h3>\n<p>Git platforms come with some great tools for tracking issues, bugs, and feature requests. In the GitHub web interface, go to the issues tab, and click the button that says \u2018new issue\u2019.<\/p>\n<p>If you ever use someone else\u2019s GitHub repository and find a bug or need help, this is where you should go to report it so that someone can fix it \u2014 but check that someone else hasn\u2019t already submitted one for the same issue!<\/p>\n<p>We\u2019re now going to create a new issue.<\/p>\n<p align=\"center\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/masteringgit-newissue.jpg\" alt=\"Creating a new issue in a GitHub repository\" width=\"650\" height=\"329\" class=\"aligncenter size-full wp-image-17402\" \/><\/p>\n<p>Fairly basic, something that we could fix ourselves. It\u2019s good practice to check for an issue or submit a ticket yourself first to ensure that you don\u2019t work on something whilst someone else is doing the same.<\/p>\n<p>Because we plan on fixing the issue, you should assign it to yourself.<\/p>\n<p align=\"center\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/masteringgit-assigningissue.jpg\" alt=\"Assigning the issue to yourself\" width=\"650\" height=\"186\" class=\"aligncenter size-full wp-image-17386\" \/><\/p>\n<p>Let\u2019s go fix that issue, and create a commit message for it. Whilst creating the commit message, we can reference the issue. The issue is given a number, in this case it\u2019s #2. To reference it, we use the same syntax.<\/p>\n<p align=\"center\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/masteringgit-changetext.jpg\" alt=\"Creating a commit message for fixing that issue\" width=\"564\" height=\"394\" class=\"aligncenter size-full wp-image-17389\" \/><\/p>\n<p>Using the keyword \u201cfixes\u201d automatically closes the issue on GitHub.<\/p>\n<h3>More advanced features<\/h3>\n<h4>.gitignore<\/h4>\n<p>When working with Git, you might see ghost files appear such as <code>.DS_Store<\/code> or <code>Thumbs.db<\/code>. You can make Git permanently ignore these sorts of files by adding a .gitignore file to your project. I recommend using <a href=\"https:\/\/www.gitignore.io\/\" target=\"_blank\">.gitignore.io<\/a> to generate a file for you based on your criteria. In the input field, add Git, Windows, macOS, and Linux.<\/p>\n<p>Depending on which tools you\u2019re using, search for them too. If you use Photoshop, add Adobe to your list. If you use the npm package manager, add Node.<\/p>\n<p>When you create the file, you\u2019ll see it in plain text in your browser. You then need to copy all the text, and copy it into a file called <code>.gitignore<\/code> inside of your project. The <code>.<\/code> is very important in getting Git to read the file as a settings file.<\/p>\n<h4>Releases<\/h4>\n<p>When you\u2019re happy with your project, you can create a release. This is a lesser used feature, but quite a nice one to use on larger projects or client projects. Go to the releases tab in the GitHub web interface. Then click \u2018create a new release\u2019.<\/p>\n<p align=\"center\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/masteringgit-releases.jpg\" alt=\"Creating a release in GitHub\" width=\"650\" height=\"420\" class=\"aligncenter size-full wp-image-17390\" \/><\/p>\n<p>In this section, I\u2019d recommend using the tagging suggestions that GitHub gives you on the right side of the input fields.<\/p>\n<p>In the text area that asks you to describe your release, you should note down your major changes. In a future release of this project, I might be able to list changes and fixes. Think of it similarly to an update to an app you have on your phone.<\/p>\n<h4>Forks<\/h4>\n<p>GitHub is filled with millions of public repositories. It also has some great ways of searching for new ones such as <a href=\"https:\/\/github.com\/explore\" target=\"_blank\">Explore<\/a>. You might find a project that would work well for your team, but needs a little bit of tweaking. You can change someone\u2019s code without annoying them, you just need to fork their code.<\/p>\n<p>Open a repository, and then along the very top there are three primary action buttons.<\/p>\n<p>\u2018Watch\u2019 allows you to get notifications to your email about changes. \u2018Star\u2019 allows you to show your support of a project. It\u2019s similar to the \u2018Like\u2019 button on Facebook or the heart on Twitter. And finally, there\u2019s the \u2018fork\u2019 button. If you click it, you\u2019ll be taken to a new view that will look quite similar to the previous one. However, if you look across the top of the page, you\u2019ll see that the project\u2019s name is now proceeded by your username and there will be some text that says \u201cforked from username\/project\u201d.<\/p>\n<p>You\u2019re now able to clone this project to your machine and work from it locally and make as many changes as you like.<\/p>\n<p>You may even end up adding a new cool feature or fixing a bug. Then you have the ability to create a pull request to the original project and contribute to the open source ecosystem. You\u2019re also now able to use Git in a work environment, you know the basics and that\u2019s all you need to know to get started and to get your colleagues involved too. One of the great things about Git is that you can make it fit to your needs and requirements. There aren\u2019t really too many right or wrongs.<\/p>\n<h3>Resources<\/h3>\n<p>In this article we used the tools <a href=\"https:\/\/github.com\/\" target=\"_blank\">GitHub<\/a> and the <a href=\"https:\/\/desktop.github.com\/\" target=\"_blank\">GitHub Desktop app<\/a>. Here are some other great tools:<\/p>\n<h4>UIs<\/h4>\n<ul>\n<li><a href=\"https:\/\/www.git-tower.com\/windows\/\" target=\"_blank\">Tower<\/a>: This is one of the most advanced Git apps, but it comes with a higher price tag.<\/li>\n<li><a href=\"https:\/\/www.sourcetreeapp.com\/\" target=\"_blank\">SourceTree<\/a>: A fantastic and free Git app made by Atlassian, creators of Jira and Bitbucket.<\/li>\n<li><a href=\"https:\/\/www.goabstract.com\/\" target=\"_blank\">Abstract<\/a>: This one is specifically for design files!<\/li>\n<\/ul>\n<h4>Git platforms<\/h4>\n<ul>\n<li><a href=\"https:\/\/about.gitlab.com\/\" target=\"_blank\">Gitlab<\/a>: GitLab has free private repositories (unlike GitHub) but lacks the same community behind open source projects. You can also get a corporate plan and host it yourself.<\/li>\n<li><a href=\"https:\/\/bitbucket.org\/\" target=\"_blank\">BitBucket<\/a>: BitBucket is designed for teams and self hosting, so it\u2019s great to use in a business environment. It also integrates well with Jira.<\/li>\n<\/ul>\n<h4>Further reading<\/h4>\n<ul>\n<li><a href=\"https:\/\/help.github.com\/\" target=\"_blank\">GitHub Help<\/a>: It has a lot of content, and I don\u2019t recommend you read every word, but there\u2019s a search function to find the information you need.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Writing code and managing a good workflow is a challenge.  This is where Git comes in &#8211; letting you track every line of code added or removed.<\/p>\n","protected":false},"author":2,"featured_media":17391,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,24],"tags":[],"class_list":{"0":"post-17382","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-guest-posts","8":"category-web-design"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Mastering Git - Heart Internet<\/title>\n<meta name=\"description\" content=\"Writing code and managing a good workflow is a challenge. This is where Git comes in - letting you track every line of code added or removed.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.heartinternet.uk\/blog\/mastering-git\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Mastering Git - Heart Internet\" \/>\n<meta property=\"og:description\" content=\"Writing code and managing a good workflow is a challenge. This is where Git comes in - letting you track every line of code added or removed.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.heartinternet.uk\/blog\/mastering-git\/\" \/>\n<meta property=\"og:site_name\" content=\"Heart Internet\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/heartinternet\/\" \/>\n<meta property=\"article:published_time\" content=\"2017-11-15T13:30:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/2017\/11\/masteringgit-background.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1265\" \/>\n\t<meta property=\"og:image:height\" content=\"500\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Eliot Chambers-Ostler\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@heartinternet\" \/>\n<meta name=\"twitter:site\" content=\"@heartinternet\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Eliot Chambers-Ostler\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.heartinternet.uk\/blog\/mastering-git\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.heartinternet.uk\/blog\/mastering-git\/\"},\"author\":{\"name\":\"Eliot Chambers-Ostler\",\"@id\":\"https:\/\/heartblog.victory.digital\/#\/schema\/person\/58ed7f27cc0f3ab6e69135742a5eee28\"},\"headline\":\"Mastering Git\",\"datePublished\":\"2017-11-15T13:30:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.heartinternet.uk\/blog\/mastering-git\/\"},\"wordCount\":1998,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/heartblog.victory.digital\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.heartinternet.uk\/blog\/mastering-git\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/2017\/11\/masteringgit-background.jpg\",\"articleSection\":[\"Guest Posts\",\"Web Design\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.heartinternet.uk\/blog\/mastering-git\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.heartinternet.uk\/blog\/mastering-git\/\",\"url\":\"https:\/\/www.heartinternet.uk\/blog\/mastering-git\/\",\"name\":\"Mastering Git - Heart Internet\",\"isPartOf\":{\"@id\":\"https:\/\/heartblog.victory.digital\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.heartinternet.uk\/blog\/mastering-git\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.heartinternet.uk\/blog\/mastering-git\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/2017\/11\/masteringgit-background.jpg\",\"datePublished\":\"2017-11-15T13:30:49+00:00\",\"description\":\"Writing code and managing a good workflow is a challenge. This is where Git comes in - letting you track every line of code added or removed.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.heartinternet.uk\/blog\/mastering-git\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.heartinternet.uk\/blog\/mastering-git\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.heartinternet.uk\/blog\/mastering-git\/#primaryimage\",\"url\":\"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/2017\/11\/masteringgit-background.jpg\",\"contentUrl\":\"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/2017\/11\/masteringgit-background.jpg\",\"width\":1265,\"height\":500},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.heartinternet.uk\/blog\/mastering-git\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.heartinternet.uk\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Mastering Git\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/heartblog.victory.digital\/#website\",\"url\":\"https:\/\/heartblog.victory.digital\/\",\"name\":\"Heart Internet\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/heartblog.victory.digital\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/heartblog.victory.digital\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/heartblog.victory.digital\/#organization\",\"name\":\"Heart Internet\",\"url\":\"https:\/\/heartblog.victory.digital\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/heartblog.victory.digital\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/2025\/02\/HeartInternet_Logo_Colour.webp\",\"contentUrl\":\"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/2025\/02\/HeartInternet_Logo_Colour.webp\",\"width\":992,\"height\":252,\"caption\":\"Heart Internet\"},\"image\":{\"@id\":\"https:\/\/heartblog.victory.digital\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/heartinternet\/\",\"https:\/\/x.com\/heartinternet\",\"https:\/\/www.linkedin.com\/company\/heart-internet-ltd\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/heartblog.victory.digital\/#\/schema\/person\/58ed7f27cc0f3ab6e69135742a5eee28\",\"name\":\"Eliot Chambers-Ostler\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/heartblog.victory.digital\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/2025\/08\/cropped-Eliot-96x96.jpg\",\"contentUrl\":\"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/2025\/08\/cropped-Eliot-96x96.jpg\",\"caption\":\"Eliot Chambers-Ostler\"},\"url\":\"https:\/\/www.heartinternet.uk\/blog\/author\/eliot-chambers-ostler\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Mastering Git - Heart Internet","description":"Writing code and managing a good workflow is a challenge. This is where Git comes in - letting you track every line of code added or removed.","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:\/\/www.heartinternet.uk\/blog\/mastering-git\/","og_locale":"en_GB","og_type":"article","og_title":"Mastering Git - Heart Internet","og_description":"Writing code and managing a good workflow is a challenge. This is where Git comes in - letting you track every line of code added or removed.","og_url":"https:\/\/www.heartinternet.uk\/blog\/mastering-git\/","og_site_name":"Heart Internet","article_publisher":"https:\/\/www.facebook.com\/heartinternet\/","article_published_time":"2017-11-15T13:30:49+00:00","og_image":[{"width":1265,"height":500,"url":"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/2017\/11\/masteringgit-background.jpg","type":"image\/jpeg"}],"author":"Eliot Chambers-Ostler","twitter_card":"summary_large_image","twitter_creator":"@heartinternet","twitter_site":"@heartinternet","twitter_misc":{"Written by":"Eliot Chambers-Ostler","Estimated reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.heartinternet.uk\/blog\/mastering-git\/#article","isPartOf":{"@id":"https:\/\/www.heartinternet.uk\/blog\/mastering-git\/"},"author":{"name":"Eliot Chambers-Ostler","@id":"https:\/\/heartblog.victory.digital\/#\/schema\/person\/58ed7f27cc0f3ab6e69135742a5eee28"},"headline":"Mastering Git","datePublished":"2017-11-15T13:30:49+00:00","mainEntityOfPage":{"@id":"https:\/\/www.heartinternet.uk\/blog\/mastering-git\/"},"wordCount":1998,"commentCount":0,"publisher":{"@id":"https:\/\/heartblog.victory.digital\/#organization"},"image":{"@id":"https:\/\/www.heartinternet.uk\/blog\/mastering-git\/#primaryimage"},"thumbnailUrl":"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/2017\/11\/masteringgit-background.jpg","articleSection":["Guest Posts","Web Design"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.heartinternet.uk\/blog\/mastering-git\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.heartinternet.uk\/blog\/mastering-git\/","url":"https:\/\/www.heartinternet.uk\/blog\/mastering-git\/","name":"Mastering Git - Heart Internet","isPartOf":{"@id":"https:\/\/heartblog.victory.digital\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.heartinternet.uk\/blog\/mastering-git\/#primaryimage"},"image":{"@id":"https:\/\/www.heartinternet.uk\/blog\/mastering-git\/#primaryimage"},"thumbnailUrl":"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/2017\/11\/masteringgit-background.jpg","datePublished":"2017-11-15T13:30:49+00:00","description":"Writing code and managing a good workflow is a challenge. This is where Git comes in - letting you track every line of code added or removed.","breadcrumb":{"@id":"https:\/\/www.heartinternet.uk\/blog\/mastering-git\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.heartinternet.uk\/blog\/mastering-git\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.heartinternet.uk\/blog\/mastering-git\/#primaryimage","url":"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/2017\/11\/masteringgit-background.jpg","contentUrl":"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/2017\/11\/masteringgit-background.jpg","width":1265,"height":500},{"@type":"BreadcrumbList","@id":"https:\/\/www.heartinternet.uk\/blog\/mastering-git\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.heartinternet.uk\/blog\/"},{"@type":"ListItem","position":2,"name":"Mastering Git"}]},{"@type":"WebSite","@id":"https:\/\/heartblog.victory.digital\/#website","url":"https:\/\/heartblog.victory.digital\/","name":"Heart Internet","description":"","publisher":{"@id":"https:\/\/heartblog.victory.digital\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/heartblog.victory.digital\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/heartblog.victory.digital\/#organization","name":"Heart Internet","url":"https:\/\/heartblog.victory.digital\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/heartblog.victory.digital\/#\/schema\/logo\/image\/","url":"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/2025\/02\/HeartInternet_Logo_Colour.webp","contentUrl":"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/2025\/02\/HeartInternet_Logo_Colour.webp","width":992,"height":252,"caption":"Heart Internet"},"image":{"@id":"https:\/\/heartblog.victory.digital\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/heartinternet\/","https:\/\/x.com\/heartinternet","https:\/\/www.linkedin.com\/company\/heart-internet-ltd"]},{"@type":"Person","@id":"https:\/\/heartblog.victory.digital\/#\/schema\/person\/58ed7f27cc0f3ab6e69135742a5eee28","name":"Eliot Chambers-Ostler","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/heartblog.victory.digital\/#\/schema\/person\/image\/","url":"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/2025\/08\/cropped-Eliot-96x96.jpg","contentUrl":"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/2025\/08\/cropped-Eliot-96x96.jpg","caption":"Eliot Chambers-Ostler"},"url":"https:\/\/www.heartinternet.uk\/blog\/author\/eliot-chambers-ostler\/"}]}},"_links":{"self":[{"href":"https:\/\/www.heartinternet.uk\/blog\/wp-json\/wp\/v2\/posts\/17382","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.heartinternet.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.heartinternet.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.heartinternet.uk\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.heartinternet.uk\/blog\/wp-json\/wp\/v2\/comments?post=17382"}],"version-history":[{"count":0,"href":"https:\/\/www.heartinternet.uk\/blog\/wp-json\/wp\/v2\/posts\/17382\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.heartinternet.uk\/blog\/wp-json\/wp\/v2\/media\/17391"}],"wp:attachment":[{"href":"https:\/\/www.heartinternet.uk\/blog\/wp-json\/wp\/v2\/media?parent=17382"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.heartinternet.uk\/blog\/wp-json\/wp\/v2\/categories?post=17382"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.heartinternet.uk\/blog\/wp-json\/wp\/v2\/tags?post=17382"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}