如何使用java和github api连接到github存储库
我需要使用java(使用我的凭据)创建远程Github存储库,并且需要将.Json文件推送到该repo 我看到了一些使用JGit的示例和其他参考资料,如 我写了一些小代码如何使用java和github api连接到github存储库,java,github-api,git-remote,Java,Github Api,Git Remote,我需要使用java(使用我的凭据)创建远程Github存储库,并且需要将.Json文件推送到该repo 我看到了一些使用JGit的示例和其他参考资料,如 我写了一些小代码 GitHubClient client = new GitHubClient(); client.setCredentials("username", "password"); RepositoryService service = new RepositoryService(client); Repository re
GitHubClient client = new GitHubClient();
client.setCredentials("username", "password");
RepositoryService service = new RepositoryService(client);
Repository repo=new Repository(); repo.setName("newRepo");
service.createRepository(repo);
它不起作用了
请帮我举一个有效的例子。这将非常有用。您将在中找到关于以下方面的工作示例:
- (它可以推送您添加/提交的任何文件,JSON与否)
- (它可以推送您添加/提交的任何文件,JSON与否)