{"id":419,"date":"2021-01-23T15:42:15","date_gmt":"2021-01-23T20:42:15","guid":{"rendered":"http:\/\/www.compdigitec.com\/labs\/?p=419"},"modified":"2021-01-23T15:42:15","modified_gmt":"2021-01-23T20:42:15","slug":"git-refuses-to-discover-new-remote-branches","status":"publish","type":"post","link":"http:\/\/www.compdigitec.com\/labs\/2021\/01\/23\/git-refuses-to-discover-new-remote-branches\/","title":{"rendered":"Git refuses to discover new remote branches"},"content":{"rendered":"<p>In addition to the excellent suggestions at <a rel=\"noreferrer noopener\" href=\"https:\/\/stackoverflow.com\/questions\/1783405\/how-do-i-check-out-a-remote-git-branch\" target=\"_blank\">https:\/\/stackoverflow.com\/questions\/1783405\/how-do-i-check-out-a-remote-git-branch<\/a>, take a look in .git\/config and make sure fetch is specified to only fetch the master branch:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[remote \"origin\"]\n  url = git@github.com:example\/coolproject.git\n  fetch = +refs\/heads\/master:refs\/remotes\/origin\/master # bad<\/pre>\n\n\n\n<p>You&#8217;ll want to change the fetch line to fetch all branches instead:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[remote \"origin\"]\n  url = git@github.com:example\/coolproject.git\n  fetch = +refs\/heads\/*:refs\/remotes\/origin\/*<\/pre>","protected":false},"excerpt":{"rendered":"<p>In addition to the excellent suggestions at https:\/\/stackoverflow.com\/questions\/1783405\/how-do-i-check-out-a-remote-git-branch, take a look in .git\/config and make sure fetch is specified to only fetch the master branch: [remote &#8220;origin&#8221;] url = git@github.com:example\/coolproject.git fetch = +refs\/heads\/master:refs\/remotes\/origin\/master # bad You&#8217;ll want to change the fetch line to fetch all branches instead: [remote &#8220;origin&#8221;] url = git@github.com:example\/coolproject.git fetch = +refs\/heads\/*:refs\/remotes\/origin\/*<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[893,894,771,895,896],"_links":{"self":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts\/419"}],"collection":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/comments?post=419"}],"version-history":[{"count":0,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts\/419\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/media?parent=419"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/categories?post=419"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/tags?post=419"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}