{"id":6052,"date":"2025-04-23T09:59:52","date_gmt":"2025-04-23T00:59:52","guid":{"rendered":"https:\/\/dandelions.co.jp\/blog\/?p=6052"},"modified":"2025-04-23T09:59:52","modified_gmt":"2025-04-23T00:59:52","slug":"engineer-blog-the-basics-of-git","status":"publish","type":"post","link":"https:\/\/dandelions.co.jp\/blog\/blog\/2025\/04\/23\/engineer-blog-the-basics-of-git\/","title":{"rendered":"Engineer Blog \u2013 The Basics of Git"},"content":{"rendered":"\n<p>Welcome to our engineer blog, where we share what we\u2019re learning day to day.<br>Recently, I had a chance to work with Git, so in this post, I\u2019ll be explaining its basic concepts.<\/p>\n\n\n\n<p>Have you ever saved multiple versions of the same file on an external hard drive or similar device, managing them by changing the filenames like this?<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"371\" height=\"147\" src=\"http:\/\/dandelions.co.jp\/blog\/wp\/wp-content\/uploads\/2025\/04\/1.jpg\" alt=\"\" class=\"wp-image-6038\" srcset=\"https:\/\/dandelions.co.jp\/blog\/wp\/wp-content\/uploads\/2025\/04\/1.jpg 371w, https:\/\/dandelions.co.jp\/blog\/wp\/wp-content\/uploads\/2025\/04\/1-300x119.jpg 300w\" sizes=\"(max-width: 371px) 100vw, 371px\" \/><figcaption><em>Multiple versions of the same file. \u201cF\u201d stands for \u201cFinal,\u201d and the more F\u2019s you have, the more \u201cfinal\u201d it seems.<\/em><\/figcaption><\/figure>\n\n\n\n<p>This kind of versioning might be enough for personal files, but when it comes to managing source code in a large-scale project, a more precise and structured system is needed. That\u2019s where Git comes in.<\/p>\n\n\n\n<h2>What Is Git?<\/h2>\n\n\n\n<p>Git is a <strong>Version Control System (VCS)<\/strong>. Its role is to track and manage the history of changes to files. With this tracking, you can return files to a specific past state and compare or merge changes.<\/p>\n\n\n\n<p>In particular, for projects involving multiple people, using Git makes it possible to visualize which files were changed, when, and by whom\u2014helping to prevent accidental overwrites or unintended edits.<\/p>\n\n\n\n<h2>What Is a Repository?<\/h2>\n\n\n\n<p>The files managed by Git are stored in a <strong>repository<\/strong>. Repositories are generally classified into two types: <strong>local<\/strong> and <strong>remote<\/strong>. When saving files, it\u2019s important to be aware of which repository your changes are being applied to.<\/p>\n\n\n\n<p>Git is a <strong>distributed<\/strong> VCS, meaning each developer maintains a full history of the project in their local repository. This makes it possible to edit files and review history even while offline.<\/p>\n\n\n\n<p>Remote repositories are hosted by providers like <strong>GitHub<\/strong>, <strong>GitLab<\/strong>, or <strong>Bitbucket<\/strong>. (Of course, you can also create and manage your own.) Because the storage is online, it becomes easy to share work and collaborate with others.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" src=\"http:\/\/dandelions.co.jp\/blog\/wp\/wp-content\/uploads\/2025\/04\/2-1024x634.jpg\" alt=\"\" class=\"wp-image-6039\" width=\"537\" height=\"332\" srcset=\"https:\/\/dandelions.co.jp\/blog\/wp\/wp-content\/uploads\/2025\/04\/2-1024x634.jpg 1024w, https:\/\/dandelions.co.jp\/blog\/wp\/wp-content\/uploads\/2025\/04\/2-300x186.jpg 300w, https:\/\/dandelions.co.jp\/blog\/wp\/wp-content\/uploads\/2025\/04\/2-768x475.jpg 768w, https:\/\/dandelions.co.jp\/blog\/wp\/wp-content\/uploads\/2025\/04\/2.jpg 1167w\" sizes=\"(max-width: 537px) 100vw, 537px\" \/><figcaption>Types of Repositories<\/figcaption><\/figure>\n\n\n\n<h2>What Is a Branch?<\/h2>\n\n\n\n<p>When adding a new feature or making changes that might affect existing code in uncertain ways, it\u2019s risky to update the main project source directly. In such cases, you can create an <strong>independent branch<\/strong>. This lets you safely develop and test features without impacting the main codebase.<\/p>\n\n\n\n<p>Once the new feature or fix is complete and has passed testing, the branch can be merged into the main project to officially apply the changes.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" src=\"http:\/\/dandelions.co.jp\/blog\/wp\/wp-content\/uploads\/2025\/04\/3-3-1024x565.jpg\" alt=\"\" class=\"wp-image-6049\" width=\"496\" height=\"273\" srcset=\"https:\/\/dandelions.co.jp\/blog\/wp\/wp-content\/uploads\/2025\/04\/3-3-1024x565.jpg 1024w, https:\/\/dandelions.co.jp\/blog\/wp\/wp-content\/uploads\/2025\/04\/3-3-300x166.jpg 300w, https:\/\/dandelions.co.jp\/blog\/wp\/wp-content\/uploads\/2025\/04\/3-3-768x424.jpg 768w, https:\/\/dandelions.co.jp\/blog\/wp\/wp-content\/uploads\/2025\/04\/3-3.jpg 1426w\" sizes=\"(max-width: 496px) 100vw, 496px\" \/><figcaption>Branching and Merging<\/figcaption><\/figure>\n\n\n\n<p>Stay tuned for the next post in our Engineer Blog series!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Welcome to our engineer blog, where we share what we\u2019re learning day to day.Recently, I had a chance to work w &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/dandelions.co.jp\/blog\/blog\/2025\/04\/23\/engineer-blog-the-basics-of-git\/\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Engineer Blog \u2013 The Basics of Git&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[8],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/paR9rw-1zC","_links":{"self":[{"href":"https:\/\/dandelions.co.jp\/blog\/wp-json\/wp\/v2\/posts\/6052"}],"collection":[{"href":"https:\/\/dandelions.co.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dandelions.co.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dandelions.co.jp\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dandelions.co.jp\/blog\/wp-json\/wp\/v2\/comments?post=6052"}],"version-history":[{"count":2,"href":"https:\/\/dandelions.co.jp\/blog\/wp-json\/wp\/v2\/posts\/6052\/revisions"}],"predecessor-version":[{"id":6054,"href":"https:\/\/dandelions.co.jp\/blog\/wp-json\/wp\/v2\/posts\/6052\/revisions\/6054"}],"wp:attachment":[{"href":"https:\/\/dandelions.co.jp\/blog\/wp-json\/wp\/v2\/media?parent=6052"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dandelions.co.jp\/blog\/wp-json\/wp\/v2\/categories?post=6052"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dandelions.co.jp\/blog\/wp-json\/wp\/v2\/tags?post=6052"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}