【发布时间】:2016-08-18 22:20:20
【问题描述】:
我使用此代码从 Guthub 获取所有提交。我只想从今天开始提交。
public void listCommits(String user_name, String password) throws IOException
{
GitHubClient client = new GitHubClient();
client.setCredentials(user_name, password);
RepositoryService service = new RepositoryService(client);
List<Repository> repositories = service.getRepositories();
for (int i = 0; i < repositories.size(); i++)
{
Repository get = repositories.get(i);
System.out.println("Repository Name: " + get.getName());
CommitService commitService = new CommitService(client);
for (RepositoryCommit commit : commitService.getCommits(get))
{
System.out.println("Repository commit: " + commit.getCommit().getMessage());
System.out.println("Repository commit date : " + commit.getCommit().getCommitter().getDate());
}
}
}
有没有办法只从今天开始获取提交?
【问题讨论】:
标签: java github github-api