Home > Software design >  GitHub GUI does not list all the branches that git branch -a does
GitHub GUI does not list all the branches that git branch -a does

Time:06-29

Why do I only see a subset of the branches in the github GUI as compared to listing them from the terminal?

GUI:

enter image description here

command line: git branch -a output is a list of local and remote branches, including more remote branches than those in GUI

  experiments                  c52ef92 gp_sample_prior_functions
  load_profiles                a487d05 rename machine
* main                         d0c4531 update url path for img/
  models                       c09856c inverse transform the standardization and normalization of data
  temporal                     f9ad6d0 temporal aggregation and visualize kW / kWH
  remotes/origin/HEAD          -> origin/main
  remotes/origin/experiments   c52ef92 gp_sample_prior_functions
  remotes/origin/load_profiles a487d05 rename machine
  remotes/origin/main          d0c4531 update url path for img/
  remotes/origin/models        c09856c inverse transform the standardization and normalization of data
  remotes/origin/temporal      f9ad6d0 temporal aggregation and visualize kW / kWH

CodePudding user response:

git branch -a lists two kinds of branch: local branches and remote tracking branches.

Start by saying git fetch --prune on your machine. Now your remotes/origin branches match GitHub. So much for your remote tracking branches.

And GitHub does not list your local branches, because they are local to you alone. So there is nothing more to worry about.

CodePudding user response:

Those remote branches were probably deleted on github.

Your local git will not automatically "forget" about those (now deleted) remote-branches (in order to prevent possible unwanted data loss, I guess).

If you want to remove locally stored remote branches that are no longer available on the remote server, use git fetch --prune

  • Related