Git cannot see remote branches in Android studio
I only have the basic knowledge of GIT
I only use the command line and the following commands to clone a single branch from my remote (the repository has multiple branches when cloning)
git clone <url> --branch <branch> --single-branch
I can use my android studio ide VCs support for cloning branches to complete all git operations. Now I want to switch my remote branches, but my android studio ide does not display remote branches. It only displays one branch I have cloned. From my search, I checked the following solutions, but they did not work
Refresh remote Git branches in Android studio
How do I get a list of remote branches without cloning the primary branch from scratch?
resolvent:
You only see one branch because you use – single branch
From git documentation:
To undo this:
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
git fetch origin
To add a single branch:
git remote set-branches --add origin [remote-branch]
git fetch origin [remote-branch]:[local-branch]