{"id":33124,"date":"2023-01-21T17:05:15","date_gmt":"2023-01-21T17:05:15","guid":{"rendered":"https:\/\/mailinvest.blog\/index.php\/2023\/01\/21\/how-to-checkout-a-remote-git-branch\/"},"modified":"2023-01-21T17:06:12","modified_gmt":"2023-01-21T17:06:12","slug":"how-to-checkout-a-remote-git-branch","status":"publish","type":"post","link":"https:\/\/mailinvest.blog\/index.php\/2023\/01\/21\/how-to-checkout-a-remote-git-branch\/","title":{"rendered":"How to Checkout a Remote Git Branch"},"content":{"rendered":"<p> <a href=\"https:\/\/go.fiverr.com\/visit\/?bta=1052423&nci=17043\" Target=\"_Top\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"https:\/\/fiverr.ck-cdn.com\/tn\/serve\/?cid=40081059\"  width=\"601\" height=\"201\"><\/a>\n<\/p>\n<div>\n<!-- UNCACHED CONTENT --><\/p>\n<figure style=\"width: 1200px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"type:primaryImage size-full wp-image-791996\" data-pagespeed-no-defer=\"\" src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/03\/shutterstock_321627716.png?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Linux laptop showing a bash prompt\" width=\"1200\" height=\"675\"\/><figcaption class=\"wp-caption-text\"><span class=\"type:primaryImage imagecredit\"><a href=\"https:\/\/www.shutterstock.com\/image-vector\/linux-interface-screen-notebook-world-map-321627716\">fatmawati achmad zaenuri\/Shutterstock.com<\/a><\/span><\/figcaption><\/figure>\n<p>To checkout a department from a distant repository, use the &#8216;git fetch&#8217; command, after which &#8216;git department -r&#8217; to record the distant branches. Choose the department you want and use a command of the shape &#8216;git checkout -b new-branch-name origin\/remote-branch-name.&#8217; When you use a number of repositories change the &#8216;origin&#8217; a part of the checkout command to the title of the distant you want to checkout the department from.<\/p>\n<p>In case your improvement workforce makes use of Git, you\u2019ll ultimately want to take a look at another person\u2019s work as a department from a distant repository. Like most department actions in Git, switching to a distant department is definitely fairly easy.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><a name=\"autotoc_anchor_0\"\/>Git, Branches, and Remotes<\/h2>\n<p>The <a href=\"https:\/\/git-scm.com\/\">Git<\/a> philosophy is to department typically. <a href=\"https:\/\/www.howtogeek.com\/devops\/how-do-git-branches-work\/\">Branches<\/a> permit improvement to happen with out altering the primary code base. When you find yourself happy that your new, examined code is prepared, you <a href=\"https:\/\/www.howtogeek.com\/853521\/git-merge\/\">merge your new branch<\/a> into one other department. Often, that is the primary or grasp department, however you&#8217;ll be able to merge any two branches.<\/p>\n<p>Due to this flexibility, and the light-weight and quick approach that Git handles branches and merges, branching was reworked. In older model management techniques, branching was an enormous deal. Branching and merging had been sluggish and error-prone. Git gave builders straightforward, quick branching that\u2019s used to underpin many various workflows.<\/p>\n<p>When you work or volunteer as a part of a improvement workforce utilizing Git, you\u2019ll have a \u201ccentral\u201d Git repository, distant from every software program engineer\u2019s laptop. This is named the distant repository, or simply the \u201cdistant.\u201d It\u2019s the place the commits and adjustments to your native repository get despatched if you carry out a push.<\/p>\n<p>After all, that\u2019s what the opposite builders are doing, too. This makes it straightforward to collaborate. If it is advisable to entry one other developer\u2019s work, you simply retrieve their code from a department on the distant repository. If they should entry your work, they\u2019ll retrieve your code from a department on the repository that tracks certainly one of your native branches.<\/p>\n<p>In Git, a improvement venture can have <a href=\"https:\/\/www.howtogeek.com\/devops\/how-to-use-git-with-multiple-remote-repositories\/\">multiple remotes<\/a>. Nonetheless, an area department can solely monitor a single distant department. So, so long as you&#8217;re working with the suitable distant, trying out a distant department with a number of remotes is similar as utilizing a single distant.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><a name=\"autotoc_anchor_1\"\/>Discovering Your Native Branches<\/h2>\n<p>You must keep away from title conflicts. In case you have an area department that occurs to have the identical title because the distant department you&#8217;re going to try, you could have two choices. You&#8217;ll be able to rename your native department and take a look at the distant department. That approach, your native department that tracks the distant department has the identical title because the distant department. Or, you&#8217;ll be able to checkout the distant department and inform Git to create an area monitoring department with a brand new title.<\/p>\n<p>To seek out out the names of the branches in your native repository, use the <code>git department<\/code> command.<\/p>\n<pre>git department<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-864265\" data-pagespeed-lazy-src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2023\/01\/1-1.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Listing local branches with the git branch command\" width=\"644\" height=\"160\" src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>This native repository has a grasp department and three different branches. The asterisk signifies which is the present department. Shifting from department to department requires trying out the department you wish to work with.<\/p>\n<pre>git checkout new-feature<\/pre>\n<pre>git standing<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-864267\" data-pagespeed-lazy-src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2023\/01\/2-1.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Checking out a local branch with the git checkout command\" width=\"644\" height=\"150\" src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>The primary command adjustments the department for us, in order that \u201cnew-feature\u201d is the present department. The <code>git standing <\/code> command verifies that for us.<\/p>\n<p>We are able to hop forwards and backwards between branches, committing new adjustments, pulling updates from the distant, and pushing native updates to the distant.<\/p>\n<p><strong>RELATED:<\/strong> <a href=\"https:\/\/www.howtogeek.com\/devops\/how-to-update-and-maintain-separate-git-branches\/\"><strong><em>How To Update and Maintain Separate Git Branches<\/em><\/strong><\/a><\/p>\n<h2 role=\"heading\" aria-level=\"2\"><a name=\"autotoc_anchor_2\"\/>Checking Out a Distant Department<\/h2>\n<p>There\u2019s a department on the distant repository that isn\u2019t current on our machine. A developer known as Mary has created a brand new function. We wish to swap to that distant department so we will construct that model of the software program domestically.<\/p>\n<p>If we carry out a <code>fetch<\/code>, Git will pull again the metadata from the distant repository.<\/p>\n<pre>git fetch<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-864268\" data-pagespeed-lazy-src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2023\/01\/3-1.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Using the git fetch command to retrieve the metadata about a remote repository\" width=\"644\" height=\"230\" src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>As a result of that is the primary <code>fetch<\/code> we\u2019ve achieved since Mary pushed her department to the distant repository, We\u2019re advised there&#8217;s a <a href=\"https:\/\/www.howtogeek.com\/714112\/how-to-create-a-new-branch-in-github\/\">new branch<\/a> known as \u201corigin\/mary-feature.\u201d The default title for the primary distant repository added to a venture is \u201corigin.\u201d<\/p>\n<p>Whether or not we see this message or not, we will all the time ask Git to record the branches within the distant repository.<\/p>\n<p>The <code>-r<\/code> (distant) possibility tells Git to report on the branches which can be on the distant repository.<\/p>\n<pre>git department -r<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-864269\" data-pagespeed-lazy-src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2023\/01\/4-1.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Using the git branch -r command to list remote branches\" width=\"644\" height=\"130\" src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>The purpose to notice right here is that Git is checking its <em>native<\/em> copy of the distant\u2019s metadata. That\u2019s why we used the <code>git fetch<\/code> command to verify the native copy of the metadata is updated.<\/p>\n<p>As soon as we spot the department we wish, we will go forward and test it out.\u00a0We use the <code>git checkout<\/code> command with the <code>-b<\/code> (department) possibility, adopted by the title we\u2019ll use for the native department, adopted by the title of the distant department.<\/p>\n<pre>git checkout -b mary-feature origin\/mary-feature<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-864270\" data-pagespeed-lazy-src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2023\/01\/5-1.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Checking out a remote branch with the git checkout -b command\" width=\"644\" height=\"130\" src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>We are able to see that we\u2019ve checked out the distant department and created an area department that can monitor adjustments within the distant department.<\/p>\n<pre>git department<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-864271\" data-pagespeed-lazy-src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2023\/01\/6-1.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Listing local branches with the git branch command, with the newly created copy of the remote branch selected as the current branch\" width=\"644\" height=\"170\" src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Our new native department is now our present working department.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><a name=\"autotoc_anchor_3\"\/>Dealing with Title Clashes<\/h2>\n<p>In case you have an area department that has the identical title because the distant department, you&#8217;ll be able to both rename your native department earlier than trying out the distant department, or checkout the distant department and specify a special native department title.<\/p>\n<p>To checkout the distant department right into a differently-named native department, we will use the identical command we used earlier, and select a brand new native department title.<\/p>\n<pre>git checkout -b mary-test origin\/mary-feature<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-864272\" data-pagespeed-lazy-src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2023\/01\/7-1.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Checking out a remote branch with the git checkout -b command with the local branch having a different name to the remote branch\" width=\"644\" height=\"130\" src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>This creates an area department known as \u201cmary-test\u201d that can monitor native commits to that department. Pushes will go to the distant \u201corigin\/mary-feature\u201d department.<\/p>\n<p>That is most likely the easiest way to deal with native title clashes. When you actually wish to maintain the title of the native and distant department the identical, you\u2019ll have to rename your native department earlier than trying out the distant.\u00a0<a href=\"https:\/\/www.howtogeek.com\/851425\/git-rename-branch\/\">Renaming a branch<\/a> is trivial in Git.<\/p>\n<pre>git department -m mary-feature old-mary-branch<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-864273\" data-pagespeed-lazy-src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2023\/01\/8-1.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Renaming a branch with the git branch -m command\" width=\"644\" height=\"75\" src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>You\u2019re now clear to checkout the distant \u201corigin\/mary-feature\u201d department.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><a name=\"autotoc_anchor_4\"\/>Dealing with A number of Distant Repositories<\/h2>\n<p>In case you have a number of distant repositories configured, it is advisable to take care you&#8217;re working with the suitable repository if you try the distant department.<\/p>\n<p>To record your distant repositories, use the <code>distant<\/code> command with the <code>-v<\/code> (view) possibility.<\/p>\n<pre>git distant -v<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-864274\" data-pagespeed-lazy-src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2023\/01\/9-1.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Listing remote repositories with the git remote -v command\" width=\"644\" height=\"150\" src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>To see all of the accessible branches, we have to fetch the <a href=\"https:\/\/www.howtogeek.com\/815069\/what-is-metadata\/\">metadata<\/a> from all our remotes, then record the distant branches.<\/p>\n<pre>git fetch --all<\/pre>\n<pre>git department --all<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-864275\" data-pagespeed-lazy-src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2023\/01\/10-1.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Using git fetch --all to update the local metadata and using git branch --all to list all branches, local and remote\" width=\"644\" height=\"295\" src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>We are able to see the department we wish is within the \u201corigin\u201d distant. The command to test it out is in the identical format we\u2019ve already used. We have to specify the distant title, \u201corigin\u201d, in addition to the department title, \u201cmary-feature.\u201d<\/p>\n<pre>git checkout -b mary-feature origin\/mary-feature<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-864276\" data-pagespeed-lazy-src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2023\/01\/11-1.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Checking out a remote branch with the git checkout -b command, using the remote name and the branch name\" width=\"638\" height=\"130\" src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p><strong>RELATED:<\/strong> <a href=\"https:\/\/www.howtogeek.com\/devops\/how-to-switch-add-and-remove-git-remotes\/\"><strong><em>How to Switch, Add, and Remove Git Remotes<\/em><\/strong><\/a><\/p>\n<h2 role=\"heading\" aria-level=\"2\"><a name=\"autotoc_anchor_5\"\/>Earlier than You Checkout<\/h2>\n<p>Earlier than you checkout maintain a couple of issues in thoughts, and also you\u2019ll be nice.<\/p>\n<p>Ensure you keep away from title clashes. In case you have an area department with the identical title because the distant department, determine whether or not you\u2019ll rename the native department or create a department with a special title to trace the distant department.<\/p>\n<p>When you use a number of distant repositories, ensure you use the right distant.<\/p>\n<p><strong>RELATED:<\/strong> <a href=\"https:\/\/www.howtogeek.com\/849210\/git-rebase\/\"><strong><em>Git rebase: Everything You Need to Know<\/em><\/strong><\/a><\/p>\n<\/div>\n<iframe data-lazy=\"true\" data-src=\"https:\/\/www.fiverr.com\/gig_widgets?id=U2FsdGVkX18x7XQvttUTrv1oEqmGNGTgvvCUiUoJ\/AP4z\/UyMz8lXGOLpu15jIMxBbTR0gmD5uBoFvhC4KWeALQRp3h\/X\/AwcVD0K8Wj9H\/ZzYKzcCNHosB9oS4SCJJFWiN85P9ICAc4OgCoE\/wHKIY7CDkf2\/DQ1vqGvk4smVe5cRDEmrLPCWi4FC8p40VUhSmWQ5udCm0zoJtorgWv3vbDQw0kKYkwn39ozAnQXDe+YvWMxkLFWA+O3TFwkJvdkIK+\/AUSnRssPKt5WHY0FhNOxnSPcLslEL4G4\/RfP95ve99U+kRnDy3X+KtzdQLY+u935ghON\/o3UE4IMv9oN6JX9RnxzL\/LRcOgnHigxStSGPKsZYtnz8RWNVT\/rOLAibqiWJadC5MYHRbekF3eg6FOGrQGkXYbsn0+a5aovnlLCbLwIqY9fcS17UX8J235iQ6cdmHNbrPeS84CMm34RA==&affiliate_id=1052423&strip_google_tagmanager=true\" loading=\"lazy\" data-with-title=\"true\" class=\"fiverr_nga_frame\" frameborder=\"0\" height=\"350\" width=\"100%\" referrerpolicy=\"no-referrer-when-downgrade\" data-mode=\"random_gigs\" onload=\" var frame = this; var script = document.createElement('script'); script.addEventListener('load', function() { window.FW_SDK.register(frame); }); script.setAttribute('src', 'https:\/\/www.fiverr.com\/gig_widgets\/sdk'); document.body.appendChild(script); \" ><\/iframe>\n<br \/><a href=\"https:\/\/www.howtogeek.com\/864263\/how-to-checkout-a-remote-git-branch\/\">Source link <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>fatmawati achmad zaenuri\/Shutterstock.com To checkout a department from a distant repository, use the &#8216;git fetch&#8217; command, after which &#8216;git department -r&#8217; to record the distant&#8230;<\/p>\n","protected":false},"author":1,"featured_media":23456,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-33124","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech-universe"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Checkout a Remote Git Branch - mailinvest.blog<\/title>\n<meta name=\"description\" content=\"Technology is forever changing, and there are always new pieces of technology to replace obsolete ones. Tons of people enjoy reading tech blogs on a daily basis.mailinvest.blog tracks all the latest consumer technology breakthroughs and shows you what&#039;s new, what matters and how technology can enrich your life. mailinvest.blog also provides the information, tools, and advice that helps when deciding what to buy.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/mailinvest.blog\/index.php\/2023\/01\/21\/how-to-checkout-a-remote-git-branch\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Checkout a Remote Git Branch - mailinvest.blog\" \/>\n<meta property=\"og:description\" content=\"Technology is forever changing, and there are always new pieces of technology to replace obsolete ones. Tons of people enjoy reading tech blogs on a daily basis.mailinvest.blog tracks all the latest consumer technology breakthroughs and shows you what&#039;s new, what matters and how technology can enrich your life. mailinvest.blog also provides the information, tools, and advice that helps when deciding what to buy.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/mailinvest.blog\/index.php\/2023\/01\/21\/how-to-checkout-a-remote-git-branch\/\" \/>\n<meta property=\"og:site_name\" content=\"mailinvest.blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/freelanceracademic\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-21T17:05:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-01-21T17:06:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/mailinvest.blog\/wp-content\/uploads\/2022\/12\/shutterstock_321627716.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2392\" \/>\n\t<meta property=\"og:image:height\" content=\"1342\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"admin@mailinvest.blog\" \/>\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@mailinvest.blog\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2023\\\/01\\\/21\\\/how-to-checkout-a-remote-git-branch\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2023\\\/01\\\/21\\\/how-to-checkout-a-remote-git-branch\\\/\"},\"author\":{\"name\":\"admin@mailinvest.blog\",\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/#\\\/schema\\\/person\\\/012701c4c204d4e4ebd34f926cfd31a4\"},\"headline\":\"How to Checkout a Remote Git Branch\",\"datePublished\":\"2023-01-21T17:05:15+00:00\",\"dateModified\":\"2023-01-21T17:06:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2023\\\/01\\\/21\\\/how-to-checkout-a-remote-git-branch\\\/\"},\"wordCount\":1261,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2023\\\/01\\\/21\\\/how-to-checkout-a-remote-git-branch\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/mailinvest.blog\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/shutterstock_321627716.png\",\"articleSection\":[\"Tech Universe\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2023\\\/01\\\/21\\\/how-to-checkout-a-remote-git-branch\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2023\\\/01\\\/21\\\/how-to-checkout-a-remote-git-branch\\\/\",\"url\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2023\\\/01\\\/21\\\/how-to-checkout-a-remote-git-branch\\\/\",\"name\":\"How to Checkout a Remote Git Branch - mailinvest.blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2023\\\/01\\\/21\\\/how-to-checkout-a-remote-git-branch\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2023\\\/01\\\/21\\\/how-to-checkout-a-remote-git-branch\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/mailinvest.blog\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/shutterstock_321627716.png\",\"datePublished\":\"2023-01-21T17:05:15+00:00\",\"dateModified\":\"2023-01-21T17:06:12+00:00\",\"description\":\"Technology is forever changing, and there are always new pieces of technology to replace obsolete ones. Tons of people enjoy reading tech blogs on a daily basis.mailinvest.blog tracks all the latest consumer technology breakthroughs and shows you what's new, what matters and how technology can enrich your life. mailinvest.blog also provides the information, tools, and advice that helps when deciding what to buy.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2023\\\/01\\\/21\\\/how-to-checkout-a-remote-git-branch\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2023\\\/01\\\/21\\\/how-to-checkout-a-remote-git-branch\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2023\\\/01\\\/21\\\/how-to-checkout-a-remote-git-branch\\\/#primaryimage\",\"url\":\"https:\\\/\\\/mailinvest.blog\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/shutterstock_321627716.png\",\"contentUrl\":\"https:\\\/\\\/mailinvest.blog\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/shutterstock_321627716.png\",\"width\":2392,\"height\":1342},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2023\\\/01\\\/21\\\/how-to-checkout-a-remote-git-branch\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/mailinvest.blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Checkout a Remote Git Branch\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/#website\",\"url\":\"https:\\\/\\\/mailinvest.blog\\\/\",\"name\":\"mailinvest.blog\",\"description\":\"Technology is forever changing, and there are always new pieces of technology to replace obsolete ones. Tons of people enjoy reading tech blogs on a daily basis. mailinvest.blog tracks all the latest consumer technology breakthroughs and shows you what&#039;s new, what matters and how technology can enrich your life. mailinvest.blog also provides the information, tools, and advice that helps when deciding what to buy.\",\"publisher\":{\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/mailinvest.blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/#organization\",\"name\":\"mailinvest\",\"url\":\"https:\\\/\\\/mailinvest.blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/mailinvest.blog\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/default.png\",\"contentUrl\":\"https:\\\/\\\/mailinvest.blog\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/default.png\",\"width\":1000,\"height\":1000,\"caption\":\"mailinvest\"},\"image\":{\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/freelanceracademic\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/#\\\/schema\\\/person\\\/012701c4c204d4e4ebd34f926cfd31a4\",\"name\":\"admin@mailinvest.blog\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/98ed217bd0f3d6a6dcae2d9b0c76e305b049a07275e315e1407e19ec8b08e139?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/98ed217bd0f3d6a6dcae2d9b0c76e305b049a07275e315e1407e19ec8b08e139?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/98ed217bd0f3d6a6dcae2d9b0c76e305b049a07275e315e1407e19ec8b08e139?s=96&d=mm&r=g\",\"caption\":\"admin@mailinvest.blog\"},\"sameAs\":[\"https:\\\/\\\/mailinvest.blog\",\"admin@mailinvest.blog\"],\"url\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/author\\\/adminmailinvest-blog\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Checkout a Remote Git Branch - mailinvest.blog","description":"Technology is forever changing, and there are always new pieces of technology to replace obsolete ones. Tons of people enjoy reading tech blogs on a daily basis.mailinvest.blog tracks all the latest consumer technology breakthroughs and shows you what's new, what matters and how technology can enrich your life. mailinvest.blog also provides the information, tools, and advice that helps when deciding what to buy.","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:\/\/mailinvest.blog\/index.php\/2023\/01\/21\/how-to-checkout-a-remote-git-branch\/","og_locale":"en_US","og_type":"article","og_title":"How to Checkout a Remote Git Branch - mailinvest.blog","og_description":"Technology is forever changing, and there are always new pieces of technology to replace obsolete ones. Tons of people enjoy reading tech blogs on a daily basis.mailinvest.blog tracks all the latest consumer technology breakthroughs and shows you what's new, what matters and how technology can enrich your life. mailinvest.blog also provides the information, tools, and advice that helps when deciding what to buy.","og_url":"https:\/\/mailinvest.blog\/index.php\/2023\/01\/21\/how-to-checkout-a-remote-git-branch\/","og_site_name":"mailinvest.blog","article_publisher":"https:\/\/www.facebook.com\/freelanceracademic\/","article_published_time":"2023-01-21T17:05:15+00:00","article_modified_time":"2023-01-21T17:06:12+00:00","og_image":[{"width":2392,"height":1342,"url":"https:\/\/mailinvest.blog\/wp-content\/uploads\/2022\/12\/shutterstock_321627716.png","type":"image\/png"}],"author":"admin@mailinvest.blog","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin@mailinvest.blog","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/mailinvest.blog\/index.php\/2023\/01\/21\/how-to-checkout-a-remote-git-branch\/#article","isPartOf":{"@id":"https:\/\/mailinvest.blog\/index.php\/2023\/01\/21\/how-to-checkout-a-remote-git-branch\/"},"author":{"name":"admin@mailinvest.blog","@id":"https:\/\/mailinvest.blog\/#\/schema\/person\/012701c4c204d4e4ebd34f926cfd31a4"},"headline":"How to Checkout a Remote Git Branch","datePublished":"2023-01-21T17:05:15+00:00","dateModified":"2023-01-21T17:06:12+00:00","mainEntityOfPage":{"@id":"https:\/\/mailinvest.blog\/index.php\/2023\/01\/21\/how-to-checkout-a-remote-git-branch\/"},"wordCount":1261,"commentCount":0,"publisher":{"@id":"https:\/\/mailinvest.blog\/#organization"},"image":{"@id":"https:\/\/mailinvest.blog\/index.php\/2023\/01\/21\/how-to-checkout-a-remote-git-branch\/#primaryimage"},"thumbnailUrl":"https:\/\/mailinvest.blog\/wp-content\/uploads\/2022\/12\/shutterstock_321627716.png","articleSection":["Tech Universe"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/mailinvest.blog\/index.php\/2023\/01\/21\/how-to-checkout-a-remote-git-branch\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/mailinvest.blog\/index.php\/2023\/01\/21\/how-to-checkout-a-remote-git-branch\/","url":"https:\/\/mailinvest.blog\/index.php\/2023\/01\/21\/how-to-checkout-a-remote-git-branch\/","name":"How to Checkout a Remote Git Branch - mailinvest.blog","isPartOf":{"@id":"https:\/\/mailinvest.blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/mailinvest.blog\/index.php\/2023\/01\/21\/how-to-checkout-a-remote-git-branch\/#primaryimage"},"image":{"@id":"https:\/\/mailinvest.blog\/index.php\/2023\/01\/21\/how-to-checkout-a-remote-git-branch\/#primaryimage"},"thumbnailUrl":"https:\/\/mailinvest.blog\/wp-content\/uploads\/2022\/12\/shutterstock_321627716.png","datePublished":"2023-01-21T17:05:15+00:00","dateModified":"2023-01-21T17:06:12+00:00","description":"Technology is forever changing, and there are always new pieces of technology to replace obsolete ones. Tons of people enjoy reading tech blogs on a daily basis.mailinvest.blog tracks all the latest consumer technology breakthroughs and shows you what's new, what matters and how technology can enrich your life. mailinvest.blog also provides the information, tools, and advice that helps when deciding what to buy.","breadcrumb":{"@id":"https:\/\/mailinvest.blog\/index.php\/2023\/01\/21\/how-to-checkout-a-remote-git-branch\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/mailinvest.blog\/index.php\/2023\/01\/21\/how-to-checkout-a-remote-git-branch\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/mailinvest.blog\/index.php\/2023\/01\/21\/how-to-checkout-a-remote-git-branch\/#primaryimage","url":"https:\/\/mailinvest.blog\/wp-content\/uploads\/2022\/12\/shutterstock_321627716.png","contentUrl":"https:\/\/mailinvest.blog\/wp-content\/uploads\/2022\/12\/shutterstock_321627716.png","width":2392,"height":1342},{"@type":"BreadcrumbList","@id":"https:\/\/mailinvest.blog\/index.php\/2023\/01\/21\/how-to-checkout-a-remote-git-branch\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/mailinvest.blog\/"},{"@type":"ListItem","position":2,"name":"How to Checkout a Remote Git Branch"}]},{"@type":"WebSite","@id":"https:\/\/mailinvest.blog\/#website","url":"https:\/\/mailinvest.blog\/","name":"mailinvest.blog","description":"Technology is forever changing, and there are always new pieces of technology to replace obsolete ones. Tons of people enjoy reading tech blogs on a daily basis. mailinvest.blog tracks all the latest consumer technology breakthroughs and shows you what&#039;s new, what matters and how technology can enrich your life. mailinvest.blog also provides the information, tools, and advice that helps when deciding what to buy.","publisher":{"@id":"https:\/\/mailinvest.blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/mailinvest.blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/mailinvest.blog\/#organization","name":"mailinvest","url":"https:\/\/mailinvest.blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/mailinvest.blog\/#\/schema\/logo\/image\/","url":"https:\/\/mailinvest.blog\/wp-content\/uploads\/2022\/01\/default.png","contentUrl":"https:\/\/mailinvest.blog\/wp-content\/uploads\/2022\/01\/default.png","width":1000,"height":1000,"caption":"mailinvest"},"image":{"@id":"https:\/\/mailinvest.blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/freelanceracademic\/"]},{"@type":"Person","@id":"https:\/\/mailinvest.blog\/#\/schema\/person\/012701c4c204d4e4ebd34f926cfd31a4","name":"admin@mailinvest.blog","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/98ed217bd0f3d6a6dcae2d9b0c76e305b049a07275e315e1407e19ec8b08e139?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/98ed217bd0f3d6a6dcae2d9b0c76e305b049a07275e315e1407e19ec8b08e139?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/98ed217bd0f3d6a6dcae2d9b0c76e305b049a07275e315e1407e19ec8b08e139?s=96&d=mm&r=g","caption":"admin@mailinvest.blog"},"sameAs":["https:\/\/mailinvest.blog","admin@mailinvest.blog"],"url":"https:\/\/mailinvest.blog\/index.php\/author\/adminmailinvest-blog\/"}]}},"_links":{"self":[{"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/posts\/33124","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/comments?post=33124"}],"version-history":[{"count":2,"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/posts\/33124\/revisions"}],"predecessor-version":[{"id":33126,"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/posts\/33124\/revisions\/33126"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/media\/23456"}],"wp:attachment":[{"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/media?parent=33124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/categories?post=33124"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/tags?post=33124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}