Skip to content

Instantly share code, notes, and snippets.

/github.java Secret

Created February 14, 2013 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/76b3e68cc316f94f1efb to your computer and use it in GitHub Desktop.
Save anonymous/76b3e68cc316f94f1efb to your computer and use it in GitHub Desktop.
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.egit.github.core.Repository;
import org.eclipse.egit.github.core.RepositoryBranch;
import org.eclipse.egit.github.core.RepositoryCommit;
import org.eclipse.egit.github.core.Commit;
import org.eclipse.egit.github.core.service.*;
public class GithubRepos {
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws IOException {
RepositoryService reposervice = new RepositoryService();
CommitService commitservice = new CommitService();
Repository repo = reposervice.getRepository("owner", "repo");
List<RepositoryBranch> branches = reposervice.getBranches(repo);
List<RepositoryCommit> commits = null;
ArrayList<RepositoryCommit> allcommits = null;
for (RepositoryBranch brc: branches) {
commits = commitservice.getCommits(repo, brc.getName(), null);
allcommits = new ArrayList<RepositoryCommit>(commits);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment