{"id":37604,"date":"2016-05-31T15:00:01","date_gmt":"2016-05-31T12:00:01","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=37604"},"modified":"2019-04-23T14:46:24","modified_gmt":"2019-04-23T11:46:24","slug":"git-clone-branch-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-clone-branch-example\/","title":{"rendered":"Git Clone Branch Example"},"content":{"rendered":"<h2>1. Introduction<\/h2>\n<p>In my <a href=\"https:\/\/examples.javacodegeeks.com\/author\/jun-wu\/\">previous posts<\/a> about <code>Git<\/code>, most of the contents are focusing on local repository operation. So in most of the time, you only need to deal with your local repository and operate on it.<\/p>\n<p>However, you may not only be involving in local or self operation on you code. You may cooperate with others to work on the same project. Or you may want to involve some interesting projects which are shared by others. Then <code>Github<\/code> should make you be comfortable with all these.<\/p>\n<p>Basically <code>Github<\/code> is a web-based <code>Git<\/code> repository, which is also called remote repository, compared to the local repository. It provides web-based GUI and desktop as well as mobile integration. It also provides access control and other features for collaboration, such as bug tracking, task management and wikis for every project.<\/p>\n<p>&nbsp;<br \/>\nAs <code>Github<\/code> provides so many convenience to our developers, it&#8217;s important to be familiar with how to interact with it. From the figure below, we know that this can happen. By using command <code>git pull\/clone<\/code> and <code>git push<\/code>, we can download and upload codes\/project from <code>Github<\/code>.<\/p>\n<p><figure id=\"attachment_36668\" aria-describedby=\"caption-attachment-36668\" style=\"width: 603px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/gitflow.jpg\"><img decoding=\"async\" class=\"wp-image-36668 size-full\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/gitflow.jpg\" alt=\"gitflow\" width=\"603\" height=\"524\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/gitflow.jpg 603w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/gitflow-300x261.jpg 300w\" sizes=\"(max-width: 603px) 100vw, 603px\" \/><\/a><figcaption id=\"caption-attachment-36668\" class=\"wp-caption-text\">Git repositories<\/figcaption><\/figure><\/p>\n<p>In the remote repository, you may also notice that there&#8217;ll be multiple different branches. Here you can understand branches as different versions of your project. In this article we&#8217;ll focus on how to deal with different branches\/versions in <code>Github<\/code>.<\/p>\n<p>All the examples below is shown in MacOS EI Capitan Version 10.11.3 and the Git version is 2.5.4.<\/p>\n<h2>2. Github settings<\/h2>\n<p>To work with <code>Github<\/code>, firstly you need to have a <code>Github<\/code> account. You can register one from the <a href=\"https:\/\/github.com\/\">webpage of <code>Github<\/code><\/a>. Also you need to install <code>Git<\/code> on you computer or laptop. The installation instruction could be found on my <a href=\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/create-git-repo-example\/\">previous post on git repo example<\/a>.<\/p>\n<p>Then coming back to the <code>Github<\/code> settings. Open the terminal on your computer\/laptop. Then type the following command to make sure that <code>Git<\/code> knows your user name.<\/p>\n<pre class=\"brush:bash\">$ git config --global user.name \"YOUR NAME\"\n<\/pre>\n<p>After this, you need to associate your email address with your <code>Git<\/code> commit. You can use the following command in your terminal to connect them. Here, be sure that the email address is he one that you used for register the <code>Github<\/code> account.<\/p>\n<pre class=\"brush:bash\">$ git config --global user.email \"YOUR EMAIL ADDRESS\"\n<\/pre>\n<p>Next you need to authenticate with <code>Github<\/code> from <code>Git<\/code>. When you want to connect <code>Github<\/code> from your <code>Git<\/code>, you need authentication from <code>Github<\/code>. Two methods could be chosen for this:<\/p>\n<ul>\n<li>Clone with HTTPS: the detailed instructions <a href=\"https:\/\/help.github.com\/articles\/which-remote-url-should-i-use\/#cloning-with-https-urls-recommended\">could be found here<\/a><\/li>\n<li>Clone with SSH: the detailed instructions <a href=\"https:\/\/help.github.com\/articles\/which-remote-url-should-i-use\/#cloning-with-ssh-urls\">could be found here<\/a><\/li>\n<\/ul>\n<p>After all these steps, the <code>Github<\/code> settings are done. You can go to the further part.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<h2>3. Git clone<\/h2>\n<h3>3.1 git clone command<\/h3>\n<p>As mentioned in the figure above, we can download projects from remote repository\/<code>Github<\/code>. This can be achieved by using command <code>git clone<\/code> with the git link of that project.<\/p>\n<p>For example, you may be interested in the Datastax Java driver for NoSQL database Apache Cassandra. You can go to the <code>Github<\/code> link https:\/\/github.com\/datastax\/java-driver. Below is the figure to show how it looks for this Git project.<\/p>\n<p><figure style=\"width: 860px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/java-driver.jpg\"><img decoding=\"async\" class=\"wp-image-37132 size-full\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/java-driver.jpg\" alt=\"java driver\" width=\"860\" height=\"500\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/java-driver.jpg 860w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/java-driver-300x174.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/java-driver-768x447.jpg 768w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><figcaption class=\"wp-caption-text\">Datastax Java Driver Git link<\/figcaption><\/figure><\/p>\n<p>Then if you want to download it and work on this project on your local machine. You can use&nbsp;<code>git clone<\/code>&nbsp;command. To do this, you need to find the&nbsp;<code>git<\/code>&nbsp;link for this project. For this project, the&nbsp;<code>git<\/code>&nbsp;link is https:\/\/github.com\/datastax\/java-driver.git. The position of this link is below with blue part marked and you can copy it.<\/p>\n<p><figure style=\"width: 860px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-link.jpg\"><img decoding=\"async\" class=\"wp-image-37131 size-full\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-link.jpg\" alt=\"git link\" width=\"860\" height=\"128\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-link.jpg 860w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-link-300x45.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-link-768x114.jpg 768w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><figcaption class=\"wp-caption-text\">git link for Java driver<\/figcaption><\/figure><\/p>\n<p>Then open you terminal and go to the position you want to save this project. Type&nbsp;<code>git clone https:\/\/github.com\/datastax\/java-driver.git<\/code>. Then it\u2019ll download this project to your local machine like below:<\/p>\n<p><figure id=\"attachment_37130\" aria-describedby=\"caption-attachment-37130\" style=\"width: 860px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-clone.jpg\"><img decoding=\"async\" class=\"wp-image-37130 size-full\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-clone.jpg\" alt=\"git clone\" width=\"860\" height=\"209\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-clone.jpg 860w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-clone-300x73.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-clone-768x187.jpg 768w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><figcaption id=\"caption-attachment-37130\" class=\"wp-caption-text\">git clone<\/figcaption><\/figure><\/p>\n<p>When you notice that it&#8217;s done, the whole project has been downloaded to your local repository on your machine.<\/p>\n<h3>3.2 git clone branch<\/h3>\n<p>In the <code>git<\/code> link of the Java driver, you may notice on the left side, there&#8217;s a Branch menu showing it&#8217;s in Branch: 3.0. This means that it&#8217;s current version is 3.0. Then click the menu, you can find other more different versions like below:<\/p>\n<p><figure id=\"attachment_37653\" aria-describedby=\"caption-attachment-37653\" style=\"width: 602px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-branch.jpg\"><img decoding=\"async\" class=\"wp-image-37653 size-full\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-branch.jpg\" alt=\"git branch\" width=\"602\" height=\"1116\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-branch.jpg 602w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-branch-162x300.jpg 162w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-branch-552x1024.jpg 552w\" sizes=\"(max-width: 602px) 100vw, 602px\" \/><\/a><figcaption id=\"caption-attachment-37653\" class=\"wp-caption-text\">git branch<\/figcaption><\/figure><\/p>\n<p>In the figure above, you may find out different numbers like 1.0, 2. 0, 3.0 etc. Actually these are the version name for this project. You can also click the branches like below to see the detailed information of different branches.<\/p>\n<p><figure id=\"attachment_37657\" aria-describedby=\"caption-attachment-37657\" style=\"width: 860px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-branches-figure.jpg\"><img decoding=\"async\" class=\"wp-image-37657 size-full\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-branches-figure.jpg\" alt=\"git branches figure\" width=\"860\" height=\"435\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-branches-figure.jpg 860w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-branches-figure-300x152.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-branches-figure-768x388.jpg 768w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><figcaption id=\"caption-attachment-37657\" class=\"wp-caption-text\">git branches figure<\/figcaption><\/figure>[ulp id=&#8217;pzgfvmZhgslwSymm&#8217;]<\/p>\n<p>You can&nbsp;see that there&#8217;re 41 branches for this project. Then click inside the 41 branches, you can get more detailed information on these branches like below:<\/p>\n<p><figure id=\"attachment_37656\" aria-describedby=\"caption-attachment-37656\" style=\"width: 860px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-branches-overview.jpg\"><img decoding=\"async\" class=\"wp-image-37656 size-full\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-branches-overview.jpg\" alt=\"git branches overview\" width=\"860\" height=\"649\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-branches-overview.jpg 860w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-branches-overview-300x226.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-branches-overview-768x580.jpg 768w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><figcaption id=\"caption-attachment-37656\" class=\"wp-caption-text\">git branches overview<\/figcaption><\/figure><\/p>\n<p>For example,&nbsp;the figure above shows you the overview of the whole project. You may notice that the version of 3.0 is the default version. You can also click the &#8220;Active&#8221;, &#8220;Stale&#8221;, &#8220;All branches&#8221; to check out other information for the different branches.<\/p>\n<p>Also, you can double check it through the command which version you&#8217;re in. Open a terminal, cd into the project folder you&#8217;ve cloned through the <code>git clone<\/code> command. Then type <code>git branch<\/code>, you&#8217;ll find which version you&#8217;re in. In the figure below, we can see that we&#8217;re in the version of 3.0 for the Java driver.<\/p>\n<p><figure id=\"attachment_37661\" aria-describedby=\"caption-attachment-37661\" style=\"width: 790px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-branch-command.jpg\"><img decoding=\"async\" class=\"wp-image-37661 size-full\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-branch-command.jpg\" alt=\"git branch command\" width=\"790\" height=\"168\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-branch-command.jpg 790w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-branch-command-300x64.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-branch-command-768x163.jpg 768w\" sizes=\"(max-width: 790px) 100vw, 790px\" \/><\/a><figcaption id=\"caption-attachment-37661\" class=\"wp-caption-text\">git branch command<\/figcaption><\/figure><\/p>\n<p>Also you can use command <code>git branch -a<\/code> to list all branches in this project. Similarly you can see our example below:<\/p>\n<p><figure id=\"attachment_37663\" aria-describedby=\"caption-attachment-37663\" style=\"width: 748px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-branches-list.jpg\"><img decoding=\"async\" class=\"wp-image-37663 size-full\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-branches-list.jpg\" alt=\"git branches list\" width=\"748\" height=\"1280\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-branches-list.jpg 748w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-branches-list-175x300.jpg 175w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-branches-list-598x1024.jpg 598w\" sizes=\"(max-width: 748px) 100vw, 748px\" \/><\/a><figcaption id=\"caption-attachment-37663\" class=\"wp-caption-text\">git branches list<\/figcaption><\/figure><\/p>\n<p>Through this command, you can find all branches in the whole project. After knowing all the names for all the branches. You can use command <code>git checkout<\/code> with the branch name. For example, if we want to go to the branch of version 2.1, we can use command <code>git checkout remotes\/origin\/2.1<\/code>. Note here, the name should be the same as the name after running the <code>git branch -a<\/code>. Afterwards, you can check out your current version like below:<\/p>\n<p><figure id=\"attachment_37664\" aria-describedby=\"caption-attachment-37664\" style=\"width: 860px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-checkout.jpg\"><img decoding=\"async\" class=\"wp-image-37664 size-full\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-checkout.jpg\" alt=\"git checkout\" width=\"860\" height=\"440\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-checkout.jpg 860w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-checkout-300x153.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-checkout-768x393.jpg 768w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><figcaption id=\"caption-attachment-37664\" class=\"wp-caption-text\">git checkout<\/figcaption><\/figure><\/p>\n<p>After checkout, you&#8217;ve switched to another version of the project. Then you may work on this version and add features into it.<\/p>\n<p>Finally, if you know which version you want to work with. You can specify the version branch and download it with the branch name. Here the command <code>git clone -b branchname git_link<\/code> could be used here. For example, if you know that you want to work with the version of 2.1 for Java driver. Then you can type <code>git clone -b 2.1 https:\/\/github.com\/datastax\/java-driver.git<\/code>. This will make your current HEAD pointing to the version of 2.1. You may check this version with <code>git branch<\/code> and find that it&#8217;s in version of 2.1 like below:<\/p>\n<p><figure id=\"attachment_37666\" aria-describedby=\"caption-attachment-37666\" style=\"width: 860px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-branch-specified.jpg\"><img decoding=\"async\" class=\"wp-image-37666 size-full\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-branch-specified.jpg\" alt=\"git branch specified\" width=\"860\" height=\"283\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-branch-specified.jpg 860w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-branch-specified-300x99.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/git-branch-specified-768x253.jpg 768w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><figcaption id=\"caption-attachment-37666\" class=\"wp-caption-text\">git branch specified<\/figcaption><\/figure><\/p>\n<p>From the figure above, we can see that we&#8217;re in the version of 2.1 for the Java driver.<\/p>\n<h2>4. Conclusion<\/h2>\n<p>In conclusion, <code>Git<\/code> offers you with different choices to work with different branches. You may find all branches with <code>git branch -a<\/code>. You can also download specified branch with <code>git clone -b branchname git_link<\/code>. You can also switch to specific branch with <code>git checkout branchname<\/code>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Introduction In my previous posts about Git, most of the contents are focusing on local repository operation. So in most of the time, you only need to deal with your local repository and operate on it. However, you may not only be involving in local or self operation on you code. You may cooperate &hellip;<\/p>\n","protected":false},"author":73,"featured_media":27377,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1353],"tags":[1488],"class_list":["post-37604","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-git","tag-git-clone-branch"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Git Clone Branch Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"1. Introduction In my previous posts about Git, most of the contents are focusing on local repository operation. So in most of the time, you only need to\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-clone-branch-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Git Clone Branch Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"1. Introduction In my previous posts about Git, most of the contents are focusing on local repository operation. So in most of the time, you only need to\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-clone-branch-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Examples Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2016-05-31T12:00:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-04-23T11:46:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jun Wu\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jun Wu\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-clone-branch-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-clone-branch-example\/\"},\"author\":{\"name\":\"Jun Wu\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/6593091dba631ca0f41c4ba4e7c97678\"},\"headline\":\"Git Clone Branch Example\",\"datePublished\":\"2016-05-31T12:00:01+00:00\",\"dateModified\":\"2019-04-23T11:46:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-clone-branch-example\/\"},\"wordCount\":1158,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-clone-branch-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg\",\"keywords\":[\"Git clone branch\"],\"articleSection\":[\"Git\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-clone-branch-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-clone-branch-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-clone-branch-example\/\",\"name\":\"Git Clone Branch Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-clone-branch-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-clone-branch-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg\",\"datePublished\":\"2016-05-31T12:00:01+00:00\",\"dateModified\":\"2019-04-23T11:46:24+00:00\",\"description\":\"1. Introduction In my previous posts about Git, most of the contents are focusing on local repository operation. So in most of the time, you only need to\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-clone-branch-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-clone-branch-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-clone-branch-example\/#primaryimage\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-clone-branch-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/examples.javacodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Software Development\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/software-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Git\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/software-development\/git\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Git Clone Branch Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Examples and Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/javacodegeeks\",\"https:\/\/x.com\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/6593091dba631ca0f41c4ba4e7c97678\",\"name\":\"Jun Wu\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/11\/Jun-Wu-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/11\/Jun-Wu-96x96.jpg\",\"caption\":\"Jun Wu\"},\"description\":\"Jun (Steven) Wu is a current Master student in Computer Science &amp; Engineering department of University of Nebraska Lincoln (Lincoln, NE, USA). His current interests focus on Programming Languages (Java, Python), Relational Database (MySQL), NoSQL Database (Apache Cassandra, MongoDB), and Computer Networks.\",\"sameAs\":[\"https:\/\/wuxiaomin98.wordpress.com\/\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/jun-wu\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Git Clone Branch Example - Java Code Geeks","description":"1. Introduction In my previous posts about Git, most of the contents are focusing on local repository operation. So in most of the time, you only need to","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:\/\/examples.javacodegeeks.com\/software-development\/git\/git-clone-branch-example\/","og_locale":"en_US","og_type":"article","og_title":"Git Clone Branch Example - Java Code Geeks","og_description":"1. Introduction In my previous posts about Git, most of the contents are focusing on local repository operation. So in most of the time, you only need to","og_url":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-clone-branch-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2016-05-31T12:00:01+00:00","article_modified_time":"2019-04-23T11:46:24+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg","type":"image\/jpeg"}],"author":"Jun Wu","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Jun Wu","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-clone-branch-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-clone-branch-example\/"},"author":{"name":"Jun Wu","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/6593091dba631ca0f41c4ba4e7c97678"},"headline":"Git Clone Branch Example","datePublished":"2016-05-31T12:00:01+00:00","dateModified":"2019-04-23T11:46:24+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-clone-branch-example\/"},"wordCount":1158,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-clone-branch-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg","keywords":["Git clone branch"],"articleSection":["Git"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-clone-branch-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-clone-branch-example\/","url":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-clone-branch-example\/","name":"Git Clone Branch Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-clone-branch-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-clone-branch-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg","datePublished":"2016-05-31T12:00:01+00:00","dateModified":"2019-04-23T11:46:24+00:00","description":"1. Introduction In my previous posts about Git, most of the contents are focusing on local repository operation. So in most of the time, you only need to","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-clone-branch-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-clone-branch-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-clone-branch-example\/#primaryimage","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-clone-branch-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/examples.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Software Development","item":"https:\/\/examples.javacodegeeks.com\/category\/software-development\/"},{"@type":"ListItem","position":3,"name":"Git","item":"https:\/\/examples.javacodegeeks.com\/category\/software-development\/git\/"},{"@type":"ListItem","position":4,"name":"Git Clone Branch Example"}]},{"@type":"WebSite","@id":"https:\/\/examples.javacodegeeks.com\/#website","url":"https:\/\/examples.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Examples and Code Snippets","publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/examples.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/examples.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/6593091dba631ca0f41c4ba4e7c97678","name":"Jun Wu","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/11\/Jun-Wu-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/11\/Jun-Wu-96x96.jpg","caption":"Jun Wu"},"description":"Jun (Steven) Wu is a current Master student in Computer Science &amp; Engineering department of University of Nebraska Lincoln (Lincoln, NE, USA). His current interests focus on Programming Languages (Java, Python), Relational Database (MySQL), NoSQL Database (Apache Cassandra, MongoDB), and Computer Networks.","sameAs":["https:\/\/wuxiaomin98.wordpress.com\/"],"url":"https:\/\/examples.javacodegeeks.com\/author\/jun-wu\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/37604","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/users\/73"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=37604"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/37604\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media\/27377"}],"wp:attachment":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=37604"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=37604"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=37604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}