{"id":15920,"date":"2024-07-19T03:16:10","date_gmt":"2024-07-18T23:46:10","guid":{"rendered":"https:\/\/www.itpiran.net\/blog\/?p=15920"},"modified":"2024-07-19T03:16:10","modified_gmt":"2024-07-18T23:46:10","slug":"how-to-use-git-branches","status":"publish","type":"post","link":"https:\/\/www.itpiran.net\/blog\/en\/tutorials\/how-to-use-git-branches\/","title":{"rendered":"How to use Git Branches"},"content":{"rendered":"<h2 id=\"%d9%85%d9%82%d8%af%d9%85%d9%87\">Introduction<\/h2>\n<p>This article is the third in the &quot;Using Git&quot; series. It assumes you have read both the installation article and the How to Use Git Effectively article.<\/p>\n<p>In the world of version control systems, GIT is undoubtedly one of the best in terms of flexibility. It is very easy to learn the syntax and understand how git can best serve your workflow and environment.<\/p>\n<p>This tutorial will teach you how to create two branches (master and development) and how to merge code from development to production.<\/p>\n<p>A branch, at its core, is a unique series of code changes with a unique name. Each repository can have one or more branches.<\/p>\n<p>By default the first branch is called \u201cmaster\u201d.<\/p>\n<h2 id=\"%d9%85%d8%b4%d8%a7%d9%87%d8%af%d9%87-branches\">View Branches<\/h2>\n<p>Before creating new branches, we want to see all the existing branches. We can view all the existing branches by typing the following:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>git branch -a\r\n<\/code><\/pre>\n<\/div>\n<p>Adding \u201c-a\u201d to the end of the command tells GIT that we want to see all available branches, including those we don\u2019t have in our local workspace.<\/p>\n<p>The output will be similar to the following:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>* master remotes\/origin\/master\r\n<\/code><\/pre>\n<\/div>\n<p>The asterisk next to \u201cmaster\u201d in the first line of the output indicates that we are currently on that branch. The second line simply indicates that there is a single branch on our remote, named origin, also called master.<\/p>\n<p>Now that we know how to view branches, it&#039;s time to create our first branch.<\/p>\n<h2 id=\"%d8%a7%db%8c%d8%ac%d8%a7%d8%af-branches\">Creating Branches<\/h2>\n<p>As mentioned at the beginning of this article, we want to have a development and a production setup for our coding environment.<\/p>\n<p>We want to treat the default &quot;master&quot; branch as our production and so we need to create a single branch for development or pre-production.<\/p>\n<p>To create a new branch called develop, type the following:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>git checkout -b develop\r\n<\/code><\/pre>\n<\/div>\n<p>Assuming we don&#039;t have a branch called &quot;development&quot; yet, the output will be as follows:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>Switched to a new branch 'develop'\r\n<\/code><\/pre>\n<\/div>\n<p>In the case of a branch with that name already existing, GIT tells us:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>fatal: A branch named 'develop' already exists.\r\n<\/code><\/pre>\n<\/div>\n<p>You can move back and forth between your two branches using the git checkout command:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>git checkout master\r\n<\/code><\/pre>\n<\/div>\n<p>Or<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>git checkout develop\r\n<\/code><\/pre>\n<\/div>\n<p>Assuming there is a branch you want to switch to, you will see output similar to the following:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>Switched to branch 'master'\r\n<\/code><\/pre>\n<\/div>\n<p>If you try to switch to a branch that doesn&#039;t exist, such as<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>git checkout nosuchbranch\r\n<\/code><\/pre>\n<\/div>\n<p>Git tells you:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>error: pathspec 'nosuchbranch' did not match any file(s) known to git.\r\n<\/code><\/pre>\n<\/div>\n<p>Now that we have multiple branches, we need to make good use of them. In our scenario, we use our \u201cdevelopment\u201d branch to test our changes and the master branch to release them to the public.<\/p>\n<p>To demonstrate this process, we need to go back to our development branch:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>git checkout develop\r\n<\/code><\/pre>\n<\/div>\n<h2 id=\"%d8%a7%db%8c%d8%ac%d8%a7%d8%af-%d8%aa%d8%ba%db%8c%db%8c%d8%b1%d8%a7%d8%aa-%d8%af%d8%b1-%d8%b4%d8%a7%d8%ae%d9%87-%d8%aa%d9%88%d8%b3%d8%b9%d9%87-%d9%85%d8%a7\">Making changes to our development branch<\/h2>\n<p>In this branch, we create a new empty file called \u201cdevelop.\u201d It won\u2019t exist there until we merge it into the main branch (in the next step).<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>touch develop\r\n<\/code><\/pre>\n<\/div>\n<p>Just like in the previous tutorial, we need to tell git that we want to track this new file.<\/p>\n<p>We can add the \u201cdevelop\u201d file by typing:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>git add develop\r\n<\/code><\/pre>\n<\/div>\n<p>The above set of commands creates an empty file called \u201cdevelop\u201d and adds it to GIT.<\/p>\n<p>We also need to commit this file, which will append this file to the branch we are currently in, which is \u201cdevelopment\u201d.<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>git commit -m \"develop file\" develop\r\n<\/code><\/pre>\n<\/div>\n<p>This file now exists in the development branch. As we are about to find out, it does not exist in the master branch.<\/p>\n<p>First, we want to confirm that we are currently in the development branch. We can do this by typing:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>git branch\r\n<\/code><\/pre>\n<\/div>\n<p>The output should be similar to the following figure:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>* develop master\r\n<\/code><\/pre>\n<\/div>\n<p>We already understood that the star next to the branch name indicates that we are currently on that branch.<\/p>\n<p>Running the \u201cls\u201d command shows us that these two files exist:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>ls<\/code><\/pre>\n<\/div>\n<p>The output shows us that both of our files are found with the names \u201cfile\u201d and \u201cdevelop\u201d respectively:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>develop file\r\n<\/code><\/pre>\n<\/div>\n<h2 id=\"%da%a9%d8%af-%d8%a7%d8%af%d8%ba%d8%a7%d9%85-%d8%a8%db%8c%d9%86-%d8%b4%d8%a7%d8%ae%d9%87-%d9%87%d8%a7\">Merge code between branches<\/h2>\n<p>The interesting part happens after we switch back to our original branch, which we can do with the git checkout command:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>git checkout master\r\n<\/code><\/pre>\n<\/div>\n<p>To make sure we are on the main branch, we can type the following:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>git branch\r\n<\/code><\/pre>\n<\/div>\n<p>The output tells us which branch we are on, indicated by the asterisk.<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>develop * master\r\n<\/code><\/pre>\n<\/div>\n<p>Upon running \u201cls\u201d again, it appears that our new file is missing.<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>file<\/code><\/pre>\n<\/div>\n<\/div>\n<p>It&#039;s not lost \u2013 it&#039;s in our development branch and we&#039;re in our main branch.<\/p>\n<p>In our scenario, this file represents any changes to any file (or a completely new file) that has passed all the tests in our development branch and is ready for production. The process of moving code between branches (often from development to production) is known as a merge.<\/p>\n<p>It is important to remember when merging that we want to be on the branch we want to merge into.<\/p>\n<p>In this case, we want to merge from our development branch, where the \u201cdevelop\u201d file exists, to our master branch.<\/p>\n<p>With this in mind, given that we are currently on the master branch, all we need to do is run the merge command.<\/p>\n<p>One of the options we can pass to the merge command, \u201c\u2013no-ff\u201d, means that we want git to keep all the commit messages before the merge. This makes it easier to track changes in the future.<\/p>\n<p>To merge changes from the development branch into the master branch, type the following:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>git merge develop --no-ff\r\n<\/code><\/pre>\n<\/div>\n<p>The output of the command will be similar to the following:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>Merge made by the 'recursive' strategy. 0 files changed create mode 100644 develop\r\n<\/code><\/pre>\n<\/div>\n<p>Running the ls command again confirms that our \u201cdevelop\u201d file is now in our main branch.<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>develop file\r\n<\/code><\/pre>\n<\/div>\n<p>The last thing we need to do now, to make this change to the remote server, is to push the changes, which we can do with the help of the git push command.<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>git push\r\n<\/code><\/pre>\n<\/div>\n<p>You will see output similar to the following, confirming that you have merged from your development branch to the master branch on your remote server:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>Counting objects: 4, done. Delta compression using up to 2 threads. Compressing objects: 100% (3\/3), done. Writing objects: 100% (3\/3), 332 bytes, done. Total 3 (delta 1), reused 0 (delta 0) To ssh:\/\/git@git.domain.tld\/repository 9af2dcb..53649cf master -&gt; master\r\n<\/code><\/pre>\n<\/div>\n<h2 id=\"%d9%86%d8%aa%db%8c%d8%ac%d9%87\">Result<\/h2>\n<p>By following the tutorial above, you should have a two-branch workflow setup and hopefully have a good understanding of how branching works in GIT. Let us know what you think in the comments!<\/p>","protected":false},"excerpt":{"rendered":"Introduction This article is the third part of the &quot;Using Git&quot; series. It is assumed that both articles\u2026","protected":false},"author":1,"featured_media":15921,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_yoast_wpseo_focuskw":"\u0646\u062d\u0648\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 Git Branches","_yoast_wpseo_title":"","_yoast_wpseo_metadesc":"","_yoast_wpseo_canonical":"","_yoast_wpseo_opengraph-description":"","_yoast_wpseo_opengraph-image":"","_yoast_wpseo_twitter-description":"","_yoast_wpseo_twitter-image":"","_yoast_wpseo_focuskeywords":"","_yoast_wpseo_primary_category":"193","footnotes":""},"categories":[193],"tags":[409,426],"class_list":{"0":"post-15920","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-tutorials","8":"tag-git","9":"tag-github"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u0646\u062d\u0648\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 Git Branches - \u0628\u0644\u0627\u06af ITPiran<\/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:\/\/www.itpiran.net\/blog\/en\/tutorials\/how-to-use-git-branches\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u0646\u062d\u0648\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 Git Branches - \u0628\u0644\u0627\u06af ITPiran\" \/>\n<meta property=\"og:description\" content=\"\u0645\u0642\u062f\u0645\u0647 \u0627\u06cc\u0646 \u0645\u0642\u0627\u0644\u0647 \u0633\u0648\u0645\u06cc\u0646 \u0642\u0633\u0645\u062a \u0627\u0632 \u0645\u062c\u0645\u0648\u0639\u0647 \u00ab\u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u06af\u06cc\u062a\u00bb \u0627\u0633\u062a. \u0641\u0631\u0636 \u0628\u0631 \u0627\u06cc\u0646 \u0627\u0633\u062a \u06a9\u0647 \u0647\u0645 \u0645\u0642\u0627\u0644\u0647&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.itpiran.net\/blog\/en\/tutorials\/how-to-use-git-branches\/\" \/>\n<meta property=\"og:site_name\" content=\"\u0628\u0644\u0627\u06af ITPiran\" \/>\n<meta property=\"article:published_time\" content=\"2024-07-18T23:46:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.itpiran.net\/2024\/07\/19030208\/git-branches.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1793\" \/>\n\t<meta property=\"og:image:height\" content=\"1110\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-git-branches\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-git-branches\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/person\\\/04ed27b919baca468a2273f8e4318f81\"},\"headline\":\"\u0646\u062d\u0648\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 Git Branches\",\"datePublished\":\"2024-07-18T23:46:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-git-branches\\\/\"},\"wordCount\":40,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-git-branches\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2024\\\/07\\\/19030208\\\/git-branches.jpg\",\"keywords\":[\"git\",\"github\"],\"articleSection\":[\"\u0622\u0645\u0648\u0632\u0634\u06cc\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-git-branches\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-git-branches\\\/\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-git-branches\\\/\",\"name\":\"\u0646\u062d\u0648\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 Git Branches - \u0628\u0644\u0627\u06af ITPiran\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-git-branches\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-git-branches\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2024\\\/07\\\/19030208\\\/git-branches.jpg\",\"datePublished\":\"2024-07-18T23:46:10+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-git-branches\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-git-branches\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-git-branches\\\/#primaryimage\",\"url\":\"https:\\\/\\\/cdn.itpiran.net\\\/2024\\\/07\\\/19030208\\\/git-branches.jpg\",\"contentUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2024\\\/07\\\/19030208\\\/git-branches.jpg\",\"width\":1793,\"height\":1110},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-git-branches\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u0622\u0645\u0648\u0632\u0634\u06cc\",\"item\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/category\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"\u0646\u062d\u0648\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 Git Branches\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/\",\"name\":\"\u0628\u0644\u0627\u06af ITPiran\",\"description\":\"\u0627\u062e\u0628\u0627\u0631 \u0648 \u0645\u0642\u0627\u0644\u0627\u062a \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#organization\",\"name\":\"\u0628\u0644\u0627\u06af \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646\",\"alternateName\":\"ITPIran Blog\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/cdn.itpiran.net\\\/2023\\\/12\\\/27150508\\\/cropped-ITPIRAN-BLOG-LOGO-2.png\",\"contentUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2023\\\/12\\\/27150508\\\/cropped-ITPIRAN-BLOG-LOGO-2.png\",\"width\":512,\"height\":512,\"caption\":\"\u0628\u0644\u0627\u06af \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646\"},\"image\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/person\\\/04ed27b919baca468a2273f8e4318f81\",\"name\":\"admin\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/en\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Use Git Branches - ITPiran Blog","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.itpiran.net\/blog\/en\/tutorials\/how-to-use-git-branches\/","og_locale":"en_US","og_type":"article","og_title":"\u0646\u062d\u0648\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 Git Branches - \u0628\u0644\u0627\u06af ITPiran","og_description":"\u0645\u0642\u062f\u0645\u0647 \u0627\u06cc\u0646 \u0645\u0642\u0627\u0644\u0647 \u0633\u0648\u0645\u06cc\u0646 \u0642\u0633\u0645\u062a \u0627\u0632 \u0645\u062c\u0645\u0648\u0639\u0647 \u00ab\u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u06af\u06cc\u062a\u00bb \u0627\u0633\u062a. \u0641\u0631\u0636 \u0628\u0631 \u0627\u06cc\u0646 \u0627\u0633\u062a \u06a9\u0647 \u0647\u0645 \u0645\u0642\u0627\u0644\u0647&hellip;","og_url":"https:\/\/www.itpiran.net\/blog\/en\/tutorials\/how-to-use-git-branches\/","og_site_name":"\u0628\u0644\u0627\u06af ITPiran","article_published_time":"2024-07-18T23:46:10+00:00","og_image":[{"width":1793,"height":1110,"url":"https:\/\/cdn.itpiran.net\/2024\/07\/19030208\/git-branches.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-git-branches\/#article","isPartOf":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-git-branches\/"},"author":{"name":"admin","@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/person\/04ed27b919baca468a2273f8e4318f81"},"headline":"\u0646\u062d\u0648\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 Git Branches","datePublished":"2024-07-18T23:46:10+00:00","mainEntityOfPage":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-git-branches\/"},"wordCount":40,"commentCount":0,"publisher":{"@id":"https:\/\/www.itpiran.net\/blog\/#organization"},"image":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-git-branches\/#primaryimage"},"thumbnailUrl":"https:\/\/cdn.itpiran.net\/2024\/07\/19030208\/git-branches.jpg","keywords":["git","github"],"articleSection":["\u0622\u0645\u0648\u0632\u0634\u06cc"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-git-branches\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-git-branches\/","url":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-git-branches\/","name":"How to Use Git Branches - ITPiran Blog","isPartOf":{"@id":"https:\/\/www.itpiran.net\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-git-branches\/#primaryimage"},"image":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-git-branches\/#primaryimage"},"thumbnailUrl":"https:\/\/cdn.itpiran.net\/2024\/07\/19030208\/git-branches.jpg","datePublished":"2024-07-18T23:46:10+00:00","breadcrumb":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-git-branches\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-git-branches\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-git-branches\/#primaryimage","url":"https:\/\/cdn.itpiran.net\/2024\/07\/19030208\/git-branches.jpg","contentUrl":"https:\/\/cdn.itpiran.net\/2024\/07\/19030208\/git-branches.jpg","width":1793,"height":1110},{"@type":"BreadcrumbList","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-git-branches\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.itpiran.net\/blog\/"},{"@type":"ListItem","position":2,"name":"\u0622\u0645\u0648\u0632\u0634\u06cc","item":"https:\/\/www.itpiran.net\/blog\/category\/tutorials\/"},{"@type":"ListItem","position":3,"name":"\u0646\u062d\u0648\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 Git Branches"}]},{"@type":"WebSite","@id":"https:\/\/www.itpiran.net\/blog\/#website","url":"https:\/\/www.itpiran.net\/blog\/","name":"ITPiran Blog","description":"Iranian Sustainable Trade News and Articles","publisher":{"@id":"https:\/\/www.itpiran.net\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.itpiran.net\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.itpiran.net\/blog\/#organization","name":"Sustainable Iranian Business Blog","alternateName":"ITPIran Blog","url":"https:\/\/www.itpiran.net\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdn.itpiran.net\/2023\/12\/27150508\/cropped-ITPIRAN-BLOG-LOGO-2.png","contentUrl":"https:\/\/cdn.itpiran.net\/2023\/12\/27150508\/cropped-ITPIRAN-BLOG-LOGO-2.png","width":512,"height":512,"caption":"\u0628\u0644\u0627\u06af \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646"},"image":{"@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/person\/04ed27b919baca468a2273f8e4318f81","name":"admin","url":"https:\/\/www.itpiran.net\/blog\/en\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/posts\/15920","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/comments?post=15920"}],"version-history":[{"count":2,"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/posts\/15920\/revisions"}],"predecessor-version":[{"id":15923,"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/posts\/15920\/revisions\/15923"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/media\/15921"}],"wp:attachment":[{"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/media?parent=15920"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/categories?post=15920"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/tags?post=15920"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}