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.
Asked
Active
Viewed 112 times
2 Answers
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
-
Great. And here is the command. GET /repos/:user/:repo/branches – Boz Jul 26 '11 at 17:36
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
-
1This might be what you're after then: http://stackoverflow.com/questions/6270193/multiple-working-directories-with-git – Tekkub Jul 27 '11 at 05:04