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.

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

2 Comments

I need to detect and then pull each branch into a separate folder. Look at this post to see when I asked this question stackoverflow.com/questions/6803119/… any comments welcome.
This might be what you're after then: stackoverflow.com/questions/6270193/…
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.

1 Comment

Great. And here is the command. GET /repos/:user/:repo/branches

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.