2

is there any way to list all branches in google repo?

I found it is very difficult to understand repo. Here only provide very few commands which does not not provide a list branch mechanism.

Wang
  • 7,250
  • 4
  • 35
  • 66
  • possible duplicate of [How to display available branches in Android source tree?](http://stackoverflow.com/questions/2874347/how-to-display-available-branches-in-android-source-tree) – Douglas Denhartog Sep 30 '14 at 18:33

2 Answers2

1

@ Patrick Tsai git --git-dir .repo/manifests.git/ branch -a

Wang
  • 7,250
  • 4
  • 35
  • 66
  • This lists all the branches of the manifest itself, not all the branches in all the git repositories listed in the manifest. – James Moore Jun 11 '18 at 17:27
0

is git branch not what you are looking for?

This lists all branches, e.g.:

branch_name_1
branch_name_2
*master

Note: The * preceding a branch name denotes the current branch.

To switch branches use: git checkout branch_name_#

Douglas Denhartog
  • 2,036
  • 1
  • 16
  • 23
  • git-repo is a google tool. A single google repo contains lots of git projects (hundreds!). So it will be very annoying to check the branches for projects one by one. The repo root only contains `.repo`. So it is not git tracked I think. I think the `repo` will have a "repo-branch" so it can make sure each project on the correct branches and versions. That means if I change the single sub-project branch it will mess up the repo. – Wang Sep 30 '14 at 18:20
  • Flagged as duplicate of: http://stackoverflow.com/questions/2874347/how-to-display-available-branches-in-android-source-tree – Douglas Denhartog Sep 30 '14 at 18:35
  • 1
    Thanks for point me to another post. But your answer is wrong for git-repo. It is rather a general git instruction, which I am very familiar with. And you cannot just git checkout. `git branch` also does not work normally for git-repo because the actual .git info in located in different dirs. The accept answer in another post cannot list all available branches either. – Wang Sep 30 '14 at 18:42