Compdigitec Labs

« | Home | »

Git refuses to discover new remote branches

By admin | January 23, 2021

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 "origin"]
  url = git@github.com:example/coolproject.git
  fetch = +refs/heads/master:refs/remotes/origin/master # bad

You’ll want to change the fetch line to fetch all branches instead:

[remote "origin"]
  url = git@github.com:example/coolproject.git
  fetch = +refs/heads/*:refs/remotes/origin/*

If you found this article helpful or interesting, please help Compdigitec spread the word. Don’t forget to subscribe to Compdigitec Labs for more useful and interesting articles!

Topics: Linux | 3 Comments »

3 Responses to “Git refuses to discover new remote branches”

  1. สล็อตเว็บตรง ไม่ล็อคยูส ฝากถอนออโต้เริ่มที่1บาท Says:
    January 18th, 2025 at 15:08

    … [Trackback]

    […] Find More Information here to that Topic: compdigitec.com/labs/2021/01/23/git-refuses-to-discover-new-remote-branches/ […]

  2. THWIN9 Says:
    March 10th, 2025 at 21:23

    … [Trackback]

    […] Read More on on that Topic: compdigitec.com/labs/2021/01/23/git-refuses-to-discover-new-remote-branches/ […]

  3. lottorich28 Says:
    March 13th, 2025 at 08:16

    … [Trackback]

    […] Read More Information here to that Topic: compdigitec.com/labs/2021/01/23/git-refuses-to-discover-new-remote-branches/ […]

Comments