0

Can i detect all branches in my github repos? I'd like to write a .sh script that loops thru the branches and pulls each one.

Boz
  • 1,178
  • 1
  • 12
  • 26

2 Answers2

1

The github2 module for Python provides an API library with commands for listing the branches in a repo, see this documentation.

If Python isn't your thing, take a look at the list of libraries for other languages.

seanhodges
  • 17,426
  • 15
  • 71
  • 93
1

git fetch will bring down all branches from the remote repo. Note that it will not pull the branches, pull is fetch + merge, which is probably not what you want to do.

Tekkub
  • 30,739
  • 2
  • 30
  • 20
  • I need to detect and then pull each branch into a separate folder. Look at this post to see when I asked this question http://stackoverflow.com/questions/6803119/testing-previewing-github-branches-on-a-dev-server any comments welcome. – Boz Jul 26 '11 at 20:38
  • 1
    This might be what you're after then: http://stackoverflow.com/questions/6270193/multiple-working-directories-with-git – Tekkub Jul 27 '11 at 05:04