5

I'm using this awesome library called Gift to do all of my standard git things (pulling, reading commits, etc). However, I can't seem to get the remote branches. I believe the git branch -r command will show me the branches, but the format is certainly not machine-readable:

  origin/HEAD -> origin/master
  origin/dev
  origin/gh-pages
  origin/master

I'm wondering how I can go about viewing all of the remote branches that a repository has.

Thanks!

Shamoon
  • 41,293
  • 91
  • 306
  • 570
  • You might like to try `git ls-remote ` and filter the output accordingly as mentioned in http://stackoverflow.com/questions/3471827/how-do-i-list-all-remote-branches-in-git-1-7 – harpun Jan 23 '13 at 20:15

2 Answers2

3

I guess the command you are looking for is

git ls-remote origin
Chronial
  • 66,706
  • 14
  • 93
  • 99
2

To show all of the remote repositories for pushing and pulling, try:

git remote -v

if you want more information on a specific remote and how it relates to your current repository:

git remote show <remoteName>

g19fanatic
  • 10,567
  • 6
  • 33
  • 63