{"id":740,"date":"2021-07-07T09:35:41","date_gmt":"2021-07-07T06:35:41","guid":{"rendered":"https:\/\/hygger.io\/guides\/?p=740"},"modified":"2022-01-14T15:50:35","modified_gmt":"2022-01-14T12:50:35","slug":"git","status":"publish","type":"post","link":"https:\/\/hygger.io\/guides\/agile\/software-development\/git\/","title":{"rendered":"Git"},"content":{"rendered":"<p><span data-preserver-spaces=\"true\">For Agile teams, Git is the reliable version control system and a significant part of a DevOps toolset.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">What is Git in simple words? This open-source project actively supports a range of workflows that suit the needs of any\u00a0<\/span><a class=\"editor-rtfLink\" href=\"https:\/\/hygger.io\/guides\/agile\/software-development\/\" target=\"_blank\" rel=\"noopener\"><span data-preserver-spaces=\"true\">Agile software development<\/span><\/a><span data-preserver-spaces=\"true\">\u00a0team.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">The distributed nature of Git gives it excellent performance characteristics. They provide\u00a0<\/span><a class=\"editor-rtfLink\" href=\"https:\/\/hygger.io\/guides\/agile\/software-development\/agile-developer\/\" target=\"_blank\" rel=\"noopener\"><span data-preserver-spaces=\"true\">Agile developers<\/span><\/a><span data-preserver-spaces=\"true\">\u00a0with the freedom to experiment locally and publish their changes only when they are ready for distribution to the team.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">What is the purpose of Git? What are the Git advantages? What are the types of branches in Git, and how should you use them? You probably have even more questions. This post aims to give you all the answers and clarify controversial points. Let&#8217;s dive in!<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-21320\" src=\"https:\/\/hygger.io\/wp-content\/uploads\/2021\/07\/Product-Manager-Without-Experience-Version-3.jpg\" alt=\"What is Git?\" width=\"2000\" height=\"1200\" \/><\/p>\n<h2>What Is Git?<\/h2>\n<p>If you are searching for the most widely used modern version control system over the globe, this is definitely Git. Git is an actively maintained open source project originally developed in 2005 by Linus Torvalds, the creator of the Linux kernel.<\/p>\n<p>Numerous software projects rely on Git for version control. This includes commercial projects and open source as well. Developers who have experience working with Git are widely represented in the pool of available software development talents. Git has a distributed architecture; it is an example of a Distributed Version Control System (DVCS).<\/p>\n<p>Rather than have only one place for the full version history of the software, in Git, every developer&#8217;s working code copy is also a repository that may include the full history of all changes. It is worth adding that Git was designed with performance, flexibility, and security in mind.<\/p>\n<h3>Why Git?<\/h3>\n<p>Nowadays, many developers prefer Git above all other tools around. Git can really change the way developers think of merging and branching. With Git, merging\/branching is extremely simple and cheap. They are considered one of the core parts of the daily workflow.<\/p>\n<p>Because of its simplicity and repetitive nature, branching and merging are no longer something scary. Version control tools are aimed to assist in branching\/merging more than anything else.<\/p>\n<h3>What are the origins of Git?<\/h3>\n<p><span data-preserver-spaces=\"true\">Git began with fiery controversy and creative destruction. The Linux kernel has a fairly large scope. For most of the lifetime of this open-source software project maintenance (1991\u20132002), changes to the software were passed around as patches and archived files.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">In 2002, BitKeeper &#8211; a proprietary DVCS was what the Linux kernel project began to use.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">In 2005, warm relationships between the company that developed BitKeeper and the community that developed the Linux kernel broke down. The free-of-charge status of the tool was revoked.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">This situation prompted the Linux community to create their own tool based on the lessons they learned while using BitKeeper. The new system had the following goals:<\/span><\/p>\n<ul>\n<li><span data-preserver-spaces=\"true\">Simple design<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">Advanced speed<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">Strong support for non-linear development<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">Ability to handle large projects like the Linux kernel efficiently<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">Fully distributed<\/span><\/li>\n<\/ul>\n<p><span data-preserver-spaces=\"true\">So, 2005 was the year of Git&#8217;s birth. Since that time, Git has evolved and matured but yet retains the initial qualities. It\u2019s really fast, efficient with large projects, and provides an excellent branching system for non-linear development.<\/span><\/p>\n<h3>Three states of Git<\/h3>\n<p>This is the most important thing to remember about Git if you want the rest of the learning process to run smoothly. Git has three main states that your files can be in: modified, staged, and committed.<\/p>\n<ul>\n<li>Modified files consist of files that have changed but have not yet been committed.<\/li>\n<li>A Staged file is a modified file in its current version, marked for inclusion in the next commit.<\/li>\n<li>Committed files mean that the files are already saved in your local database.<\/li>\n<\/ul>\n<h2>Git Basics: Repositories, Branches, and Commits<\/h2>\n<p><span data-preserver-spaces=\"true\">In order to see Git in practice, you should dive into some basic terms in short words.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">A location where your code is stored is a\u00a0<\/span><strong><span data-preserver-spaces=\"true\">Repository<\/span><\/strong><span data-preserver-spaces=\"true\">. In fact, this is a folder on your machine that contains your project code. After turning this folder into a Git Repository, Git manages the project code version history.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">However, the code is not directly stored in the Repository. Inside the Repository, you have\u00a0<\/span><strong><span data-preserver-spaces=\"true\">Branches<\/span><\/strong><span data-preserver-spaces=\"true\">\u00a0(subfolders). After you add the first code to the Repository, a default Main Branch is created. You are not limited to one Branch as the Repository usually has multiple Branches.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">However, the question is: Where do you store your code? Inside the Branches is the answer. Branches contain different code versions \u2014 your\u00a0<\/span><strong><span data-preserver-spaces=\"true\">Commits<\/span><\/strong><span data-preserver-spaces=\"true\">. Every single Commit is a snapshot of a specific version of the code.<\/span><\/p>\n<h2>Introducing the Git Flow Workflow<\/h2>\n<p>There are 5\u00a0 branch types in the Git flow workflow:<\/p>\n<ul>\n<li>Main<\/li>\n<li>Develop<\/li>\n<\/ul>\n<p>Supporting branches:<\/p>\n<ul>\n<li>Feature<\/li>\n<li>Release<\/li>\n<li>Hotfix<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-21321\" src=\"https:\/\/hygger.io\/wp-content\/uploads\/2021\/07\/Standup-Meeting_-02.jpg\" alt=\"Git advantages\" width=\"2000\" height=\"1200\" \/><\/p>\n<h3>1. Main Branch<\/h3>\n<p>The main branch is typically referred to as \u201cmaster\u201d but nowadays this term looks outdated, and it&#8217;s better to use the \u201cmain\u201d term instead.<\/p>\n<p>Containing production-ready code that can be released is the key goal of the main branch in the Git flow workflow.<\/p>\n<p>The main branch is created at the start of a project. It is maintained throughout the development process. It can be tagged at different commits to signify different versions or releases of the code. The other branches will be merged into the main branch after they have been competently tested.<\/p>\n<h3>2. Develop Branch<\/h3>\n<p>The Develop branch in Git workflow is created at the start of a project. It is maintained throughout the development process and includes pre-production code with newly developed features that are in the testing process.<\/p>\n<p>The features that are newly created should be based on the Develop branch. Then they should be merged back in when ready for testing.<\/p>\n<p>Git flow development also contains three types of supporting branches with their specific purposes: feature, release, and hotfix branches.<\/p>\n<h3>3. Feature Branch<\/h3>\n<p>This is the most common type of branch in the Git flow workflow. You&#8217;ll need the Feature Branch when adding new features to the code.<\/p>\n<p>You will start this branch off the develop branch when working on a new feature. Then you&#8217;ll merge your changes back into the develop branch when the feature is completed and thoroughly reviewed.<\/p>\n<h3>4. Release Branch<\/h3>\n<p>It should be used when preparing new product releases. The work being performed on Release Branches concerns finishing touches and minor bugs. They relate to new code that should be considered separately from the main Develop Branch.<\/p>\n<h3>5. Hotfix Branch<\/h3>\n<p>The Hotfix Branch is applied to quickly address necessary changes in the Main Branch.<\/p>\n<p>The Main Branch is the base of the Hotfix Branch. It should be merged back into both the Main and Develop Branches. Merging the changes from the Hotfix Branch back into the Develop Branch is critical. This ensures that the fix persists the next time the Main Branch is released.<\/p>\n<h3>What are the benefits of using Git?<\/h3>\n<ul>\n<li><span data-preserver-spaces=\"true\">Performance. Git is about great performance when it comes to version control systems. Branching, merging, and committing are well optimized for a better performance than other systems.<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">The branching model. It allows having multiple local branches which are independent of each other. This enables you to have friction-less context switching, role-based code, and disposable experimentation.<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">Security. Git handles your security with a special algorithm that manages your versions, files, and directory securely.<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">Distributed in nature. It means that the repository or the complete code base is mirrored onto the developer\u2019s system (meaning that he\/she can work on it only).<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">Staging area. There is an intermediate stage called \u201cindex\u201d in Git (also known as \u201cstaging area\u201d) where commits can be modified before completing the commit.<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">Open-source. The open-source nature invites developers to contribute to the software and make it more robust and reliable through the features and additional plugins.<\/span><\/li>\n<\/ul>\n<h2>Three Tips to Succeed<\/h2>\n<h3>1. Think about tasks as Git Branches<\/h3>\n<p><span data-preserver-spaces=\"true\">When you know all the features, when they are added to a\u00a0<\/span><a class=\"editor-rtfLink\" href=\"https:\/\/hygger.io\/guides\/agile\/product-management\/product-roadmap\/\" target=\"_blank\" rel=\"noopener\"><span data-preserver-spaces=\"true\">product roadmap<\/span><\/a><span data-preserver-spaces=\"true\">, and the development team is ready, then Git may come into play.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Product,\u00a0<\/span><a class=\"editor-rtfLink\" href=\"https:\/\/hygger.io\/guides\/agile\/software-development\/agile-qa\/\" target=\"_blank\" rel=\"noopener\"><span data-preserver-spaces=\"true\">Quality Assurance<\/span><\/a><span data-preserver-spaces=\"true\">, design, and engineering teams hold a feature kick-off meeting to get a shared understanding of what a feature will be. So, the project scope defines what tasks the feature needs to be broken down into before the team can complete it. These tasks (<\/span><a class=\"editor-rtfLink\" href=\"https:\/\/hygger.io\/guides\/agile\/project-management\/user-stories\/\" target=\"_blank\" rel=\"noopener\"><span data-preserver-spaces=\"true\">user stories<\/span><\/a><span data-preserver-spaces=\"true\">) are then assigned to individual developers.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Here Git starts to fit up into your Agile workflow. Branching is straightforward. It allows teams to easily collaborate inside one codebase. While creating a branch, developers have their own isolated version of the codebase which they can change.<\/span><\/p>\n<h3>2. Take the advantage of testing multiple branches individually<\/h3>\n<p>When branches are ready for code reviews, Git plays another key role in an Agile development workflow &#8211; testing.<\/p>\n<p>Effective Agile and DevOps teams practice code reviews and apply automated tests. Developers can easily notify their teams that the branch work is ready for review.\u00a0 A pull request is a way to ask another developer to merge one of your branches into the Main Branch and that it is ready for testing.<\/p>\n<h3>3. Get transparency and quality to Agile development<\/h3>\n<p>If you want Git to work perfectly for your Agile workflow, make sure that your Main is always green. In case a feature isn\u2019t ready, then wait for the next release. This will not be actually a big deal if you practice shorter release cycles.<\/p>\n<h4>To sum up<\/h4>\n<p>For many, this branching model has nothing shocking new. However, the \u201cbig picture\u201d figure may turn out to be tremendously useful in your projects. It forms an elegant model that is easy to comprehend. It allows team members to develop a shared understanding of the branching and releasing processes.<\/p>\n<p>Now you know all the basics of Git, so go ahead and explore it closely in practice!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For Agile teams, Git is the reliable version control system and a significant part of a DevOps toolset. What is Git in simple words? This open-source project actively supports a range of workflows that suit the needs of any\u00a0Agile software development\u00a0team. The distributed nature of Git gives it excellent performance characteristics. They provide\u00a0Agile developers\u00a0with the [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":342,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"class_list":["post-740","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-development"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<meta name=\"description\" content=\"What is Git and what benefits does it offer?\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/hygger.io\/guides\/agile\/software-development\/git\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is Git? - Hygger.io Guides\" \/>\n<meta property=\"og:description\" content=\"What is Git and what benefits does it offer?\" \/>\n<meta property=\"og:url\" content=\"https:\/\/hygger.io\/guides\/agile\/software-development\/git\/\" \/>\n<meta property=\"og:site_name\" content=\"Hygger.io Guides\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-07T06:35:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-01-14T12:50:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/hygger.io\/guides\/wp-content\/uploads\/2021\/04\/agile.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1400\" \/>\n\t<meta property=\"og:image:height\" content=\"300\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data1\" content=\"8 minutes\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/hygger.io\/guides\/#website\",\"url\":\"https:\/\/hygger.io\/guides\/\",\"name\":\"Hygger.io Guides\",\"description\":\"Hygger: Project Management Software &amp; Tools for Companies\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/hygger.io\/guides\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/hygger.io\/guides\/agile\/software-development\/git\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/hygger.io\/guides\/wp-content\/uploads\/2021\/04\/agile.png\",\"contentUrl\":\"https:\/\/hygger.io\/guides\/wp-content\/uploads\/2021\/04\/agile.png\",\"width\":1400,\"height\":300,\"caption\":\"Agile\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/hygger.io\/guides\/agile\/software-development\/git\/#webpage\",\"url\":\"https:\/\/hygger.io\/guides\/agile\/software-development\/git\/\",\"name\":\"What is Git? - Hygger.io Guides\",\"isPartOf\":{\"@id\":\"https:\/\/hygger.io\/guides\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/hygger.io\/guides\/agile\/software-development\/git\/#primaryimage\"},\"datePublished\":\"2021-07-07T06:35:41+00:00\",\"dateModified\":\"2022-01-14T12:50:35+00:00\",\"author\":{\"@id\":\"https:\/\/hygger.io\/guides\/#\/schema\/person\/cab80745946cdf5feea0cee70ab6cffc\"},\"description\":\"What is Git and what benefits does it offer?\",\"breadcrumb\":{\"@id\":\"https:\/\/hygger.io\/guides\/agile\/software-development\/git\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/hygger.io\/guides\/agile\/software-development\/git\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/hygger.io\/guides\/agile\/software-development\/git\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/hygger.io\/guides\/\",\"url\":\"https:\/\/hygger.io\/guides\/\",\"name\":\"\\u0413\\u043b\\u0430\\u0432\\u043d\\u0430\\u044f \\u0441\\u0442\\u0440\\u0430\\u043d\\u0438\\u0446\\u0430\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@id\":\"https:\/\/hygger.io\/guides\/agile\/software-development\/git\/#webpage\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/hygger.io\/guides\/#\/schema\/person\/cab80745946cdf5feea0cee70ab6cffc\",\"name\":\"Pavel Kukhnavets\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/hygger.io\/guides\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1c304a131d7d560805a98b095abf6816b67434834ab4109340b1e6dfa4061a1b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1c304a131d7d560805a98b095abf6816b67434834ab4109340b1e6dfa4061a1b?s=96&d=mm&r=g\",\"caption\":\"Pavel Kukhnavets\"},\"description\":\"Pavel is a Content Marketing Manager at Hygger.io &amp; Welldoneby.com, a project management tool loved both by tech and non-tech people. Pavel writes about the world of Agile project management, covering such topics as popular methodologies, frameworks, techniques, innovative tools, and much more that affect the overall efficiency and productivity of product teams.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/hygger.io\/guides\/wp-json\/wp\/v2\/posts\/740","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hygger.io\/guides\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hygger.io\/guides\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hygger.io\/guides\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/hygger.io\/guides\/wp-json\/wp\/v2\/comments?post=740"}],"version-history":[{"count":7,"href":"https:\/\/hygger.io\/guides\/wp-json\/wp\/v2\/posts\/740\/revisions"}],"predecessor-version":[{"id":1121,"href":"https:\/\/hygger.io\/guides\/wp-json\/wp\/v2\/posts\/740\/revisions\/1121"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hygger.io\/guides\/wp-json\/wp\/v2\/media\/342"}],"wp:attachment":[{"href":"https:\/\/hygger.io\/guides\/wp-json\/wp\/v2\/media?parent=740"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hygger.io\/guides\/wp-json\/wp\/v2\/categories?post=740"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}