github icon indicating copy to clipboard operation
github copied to clipboard

list the branches of my repository

Open GlauberF opened this issue 7 years ago • 1 comments

The documentation is a bit confusing, how do I list the branches of my repository?

I tried the way below and could not:

captura de tela de 2018-06-12 14-22-24

ps: my repository, is private

I tried without putting (apiBase), but it did not work either

GlauberF avatar Jun 12 '18 17:06 GlauberF

Hi @GlauberF,

I just made this a few moments ago, I hope that help you. PS: Using version 3.0.0

`

  const github = new Github({ token : 'yourtoken' });
 
  const me     = github.getUser();
  const organization = await github.getOrganization('yourorganization');
  const repositorie = await organization.getRepo('repo name');

  const branches = await Promise.all(repos.map(repository => repository.listBranches()));

`

lucasgmartins avatar Nov 27 '18 14:11 lucasgmartins